Public report of MainfluxLabs/mainflux, published 17 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 17 November 2026, 05:36 UTC · Survey ID cd_2a338145f8c44dd3b194fdc855c317e5
MainfluxLabs/mainflux
Measured 17 November 2026, 05:34 UTC, at code version 0926dad
First survey, so nothing to compare with yet
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 83,917 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.3 person-years · Weakest lens: Code Health, 46.3
Findings by how serious they are
51 critical1316 serious220 minor
14 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 05:34 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
64of 64 dimensions measured by tools.
1491of 1587 findings point to an exact file and line, so you can open each one in the code. The other 96 concern the repository as a whole, such as missing documentation.
64dimensions across 8 lenses, read from 83,917 lines of product code in 1 project.
MainfluxLabs/mainflux is rated At risk because critical security findings are open, most of them leaked passwords or keys. It scores 54.8 out of 100, which the At risk rating leaves unchanged.
Code Health, at 46.3, is the weakest lens and counts most in the score. The best first step is writing log messages as searchable templates, worth about 6.1 points. Making the work cancellable comes next, worth about 4.7 points. Raising Code Health to 70 would lift the score to about 61.2.
Sixteen passwords or keys in the code's history and five in the code are open to anyone who can read the repository. Eight pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Replacing each exposed password or key and pinning each tool to an exact version would close both risks. Updating the vulnerable packages would fix the five packages with a known security hole, and limiting each secret to its own step would deal with the two secrets exposed to more of the pipeline than needed. Saving the change and the message together would take care of the 11 places where data is saved and a message sent separately.
The product code is 83,917 lines, about €190,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 46.3 to 70, the lowest score rated Strong, the score would rise from 54.8 to about 61.2.
Code composition: what the lines of code are
Product code 61%Tests 39%
Rebuild cost: about €190,000 · Estimate
Cost to rebuild
€64,000 to €320,000, for 1,060 to 3,363 hours of work, about 1.3 person-years for 1 to 3 engineers
Difficulty of the problem
High, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 83,917 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.
Raises the score by about 2.3 points · Low effort · ADR Quality
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Files that change often carry extra risk · Combined risk
4 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (4 files) · Code Coverage (89 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: service.go, transport.go and REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with service.go, transport.go and REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €190,000 to build again, about 1.3 person-years of work. Its weakest lens is Code Health, at 46.3 (Weak). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Interpolated log message defeats structured logging. Of all the actions in this report, it raises the score most for the work it takes: about 6.1 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.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 10% on every change. The history of the code shows how much it changes: about 41,120 lines over the last 90 days, which is about 166,764 lines a year. At that pace, the extra work comes to an estimated 19.1 to 114.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: 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.
210 modules, with 635 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 170 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
com/MainfluxLabs/mainflux/filestore uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/filestore, while a change to com/MainfluxLabs/mainflux/filestore can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/filestore uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/filestore, while a change to com/MainfluxLabs/mainflux/filestore can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/filestore uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/filestore, while a change to com/MainfluxLabs/mainflux/filestore can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/apiutil uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/pkg/apiutil, while a change to com/MainfluxLabs/mainflux/pkg/apiutil can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/apiutil uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/apiutil uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/pkg/apiutil, while a change to com/MainfluxLabs/mainflux/pkg/apiutil can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/apiutil uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/apiutil uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/apiutil, while a change to com/MainfluxLabs/mainflux/pkg/apiutil can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/apiutil uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/dbutil uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/dbutil, while a change to com/MainfluxLabs/mainflux/pkg/dbutil can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/dbutil uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/email uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/email, while a change to com/MainfluxLabs/mainflux/pkg/email can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/email uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/events uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/pkg/events, while a change to com/MainfluxLabs/mainflux/pkg/events can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/events uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/events uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/pkg/events, while a change to com/MainfluxLabs/mainflux/pkg/events can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/events uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/events uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/events, while a change to com/MainfluxLabs/mainflux/pkg/events can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/events uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/transformers/senml uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/transformers/senml, while a change to com/MainfluxLabs/mainflux/pkg/transformers/senml can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/transformers/senml uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/uuid uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/pkg/uuid, while a change to com/MainfluxLabs/mainflux/pkg/uuid can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/uuid uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/readers uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/readers, while a change to com/MainfluxLabs/mainflux/readers can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/readers uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/audit uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/audit, while a change to com/MainfluxLabs/mainflux/audit can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/audit uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/audit uses com/MainfluxLabs/mainflux/pkg/events, so a change to com/MainfluxLabs/mainflux/pkg/events can break com/MainfluxLabs/mainflux/audit, while a change to com/MainfluxLabs/mainflux/audit can't break com/MainfluxLabs/mainflux/pkg/events.
Position
Below the diagonal: com/MainfluxLabs/mainflux/audit uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/audit uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/audit, while a change to com/MainfluxLabs/mainflux/audit can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/audit uses a module listed above it, which is the healthy direction.
39 pairs of types, where a type in com/MainfluxLabs/mainflux/auth uses a type in com/MainfluxLabs/mainflux/pkg/domain. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com/MainfluxLabs/mainflux/auth uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/auth, while a change to com/MainfluxLabs/mainflux/auth can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/auth uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/auth, while a change to com/MainfluxLabs/mainflux/auth can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/auth uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/auth, while a change to com/MainfluxLabs/mainflux/auth can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/filestore uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/filestore, while a change to com/MainfluxLabs/mainflux/cmd/filestore can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/filestore uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/filestore, while a change to com/MainfluxLabs/mainflux/cmd/filestore can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/filestore uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/filestore, while a change to com/MainfluxLabs/mainflux/cmd/filestore can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/filestore uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/filestore, while a change to com/MainfluxLabs/mainflux/cmd/filestore can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/filestore uses com/MainfluxLabs/mainflux/filestore, so a change to com/MainfluxLabs/mainflux/filestore can break com/MainfluxLabs/mainflux/cmd/filestore, while a change to com/MainfluxLabs/mainflux/cmd/filestore can't break com/MainfluxLabs/mainflux/filestore.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/filestore uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/pkg/messaging, while a change to com/MainfluxLabs/mainflux/pkg/messaging can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging uses com/MainfluxLabs/mainflux/pkg/transformers/senml, so a change to com/MainfluxLabs/mainflux/pkg/transformers/senml can break com/MainfluxLabs/mainflux/pkg/messaging, while a change to com/MainfluxLabs/mainflux/pkg/messaging can't break com/MainfluxLabs/mainflux/pkg/transformers/senml.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging uses a module listed above it, which is the healthy direction.
54 pairs of types, where a type in com/MainfluxLabs/mainflux/things uses a type in com/MainfluxLabs/mainflux/pkg/domain. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com/MainfluxLabs/mainflux/things uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/things, while a change to com/MainfluxLabs/mainflux/things can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/things uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/things, while a change to com/MainfluxLabs/mainflux/things can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/things uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/things, while a change to com/MainfluxLabs/mainflux/things can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/uiconfigs, while a change to com/MainfluxLabs/mainflux/uiconfigs can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/uiconfigs, while a change to com/MainfluxLabs/mainflux/uiconfigs can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs uses com/MainfluxLabs/mainflux/pkg/apiutil, so a change to com/MainfluxLabs/mainflux/pkg/apiutil can break com/MainfluxLabs/mainflux/uiconfigs, while a change to com/MainfluxLabs/mainflux/uiconfigs can't break com/MainfluxLabs/mainflux/pkg/apiutil.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/uiconfigs, while a change to com/MainfluxLabs/mainflux/uiconfigs can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/users uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/users, while a change to com/MainfluxLabs/mainflux/users can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/users uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/users, while a change to com/MainfluxLabs/mainflux/users can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/users uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/users, while a change to com/MainfluxLabs/mainflux/users can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/users uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/users, while a change to com/MainfluxLabs/mainflux/users can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/certs uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/certs, while a change to com/MainfluxLabs/mainflux/certs can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/certs uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/certs, while a change to com/MainfluxLabs/mainflux/certs can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/certs uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/certs, while a change to com/MainfluxLabs/mainflux/certs can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/certs uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/certs, while a change to com/MainfluxLabs/mainflux/certs can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/pkg/email, so a change to com/MainfluxLabs/mainflux/pkg/email can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/pkg/email.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/pkg/events, so a change to com/MainfluxLabs/mainflux/pkg/events can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/pkg/events.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/auth uses com/MainfluxLabs/mainflux/auth, so a change to com/MainfluxLabs/mainflux/auth can break com/MainfluxLabs/mainflux/cmd/auth, while a change to com/MainfluxLabs/mainflux/cmd/auth can't break com/MainfluxLabs/mainflux/auth.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/auth uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/pkg/email, so a change to com/MainfluxLabs/mainflux/pkg/email can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/pkg/email.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/pkg/events, so a change to com/MainfluxLabs/mainflux/pkg/events can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/pkg/events.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/things uses com/MainfluxLabs/mainflux/things, so a change to com/MainfluxLabs/mainflux/things can break com/MainfluxLabs/mainflux/cmd/things, while a change to com/MainfluxLabs/mainflux/cmd/things can't break com/MainfluxLabs/mainflux/things.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/things uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/pkg/email, so a change to com/MainfluxLabs/mainflux/pkg/email can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/pkg/email.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/users uses com/MainfluxLabs/mainflux/users, so a change to com/MainfluxLabs/mainflux/users can break com/MainfluxLabs/mainflux/cmd/users, while a change to com/MainfluxLabs/mainflux/cmd/users can't break com/MainfluxLabs/mainflux/users.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/users uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/consumers, while a change to com/MainfluxLabs/mainflux/consumers can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/downlinks uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/downlinks, while a change to com/MainfluxLabs/mainflux/downlinks can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/downlinks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/downlinks uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/downlinks, while a change to com/MainfluxLabs/mainflux/downlinks can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/downlinks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/downlinks uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/downlinks, while a change to com/MainfluxLabs/mainflux/downlinks can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/downlinks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/downlinks uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/downlinks, while a change to com/MainfluxLabs/mainflux/downlinks can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/downlinks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/downlinks uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/downlinks, while a change to com/MainfluxLabs/mainflux/downlinks can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/downlinks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/modbus uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/modbus, while a change to com/MainfluxLabs/mainflux/modbus can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/modbus uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/modbus uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/modbus, while a change to com/MainfluxLabs/mainflux/modbus can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/modbus uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/modbus uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/modbus, while a change to com/MainfluxLabs/mainflux/modbus can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/modbus uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/modbus uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/modbus, while a change to com/MainfluxLabs/mainflux/modbus can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/modbus uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/modbus uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/modbus, while a change to com/MainfluxLabs/mainflux/modbus can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/modbus uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/mqtt uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/mqtt, while a change to com/MainfluxLabs/mainflux/mqtt can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/mqtt uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/mqtt, while a change to com/MainfluxLabs/mainflux/mqtt can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/mqtt uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/mqtt, while a change to com/MainfluxLabs/mainflux/mqtt can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/mqtt uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/mqtt, while a change to com/MainfluxLabs/mainflux/mqtt can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/mqtt uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/mqtt, while a change to com/MainfluxLabs/mainflux/mqtt can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/uiconfigs/api/http/backup, while a change to com/MainfluxLabs/mainflux/uiconfigs/api/http/backup can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/uiconfigs/api/http/backup, while a change to com/MainfluxLabs/mainflux/uiconfigs/api/http/backup can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses com/MainfluxLabs/mainflux/pkg/apiutil, so a change to com/MainfluxLabs/mainflux/pkg/apiutil can break com/MainfluxLabs/mainflux/uiconfigs/api/http/backup, while a change to com/MainfluxLabs/mainflux/uiconfigs/api/http/backup can't break com/MainfluxLabs/mainflux/pkg/apiutil.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses com/MainfluxLabs/mainflux/uiconfigs, so a change to com/MainfluxLabs/mainflux/uiconfigs can break com/MainfluxLabs/mainflux/uiconfigs/api/http/backup, while a change to com/MainfluxLabs/mainflux/uiconfigs/api/http/backup can't break com/MainfluxLabs/mainflux/uiconfigs.
Position
Below the diagonal: com/MainfluxLabs/mainflux/uiconfigs/api/http/backup uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/certs uses com/MainfluxLabs/mainflux/certs, so a change to com/MainfluxLabs/mainflux/certs can break com/MainfluxLabs/mainflux/cmd/certs, while a change to com/MainfluxLabs/mainflux/cmd/certs can't break com/MainfluxLabs/mainflux/certs.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/certs uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/mqtt uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/mqtt, while a change to com/MainfluxLabs/mainflux/cmd/mqtt can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/mqtt uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/mqtt, while a change to com/MainfluxLabs/mainflux/cmd/mqtt can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/mqtt uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/mqtt, while a change to com/MainfluxLabs/mainflux/cmd/mqtt can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/mqtt uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/mqtt, while a change to com/MainfluxLabs/mainflux/cmd/mqtt can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/mqtt uses com/MainfluxLabs/mainflux/mqtt, so a change to com/MainfluxLabs/mainflux/mqtt can break com/MainfluxLabs/mainflux/cmd/mqtt, while a change to com/MainfluxLabs/mainflux/cmd/mqtt can't break com/MainfluxLabs/mainflux/mqtt.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/mqtt uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/alarms uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/consumers/alarms, while a change to com/MainfluxLabs/mainflux/consumers/alarms can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/alarms uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/alarms uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/consumers/alarms, while a change to com/MainfluxLabs/mainflux/consumers/alarms can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/alarms uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/alarms uses com/MainfluxLabs/mainflux/consumers, so a change to com/MainfluxLabs/mainflux/consumers can break com/MainfluxLabs/mainflux/consumers/alarms, while a change to com/MainfluxLabs/mainflux/consumers/alarms can't break com/MainfluxLabs/mainflux/consumers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/alarms uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/notifiers uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/consumers/notifiers, while a change to com/MainfluxLabs/mainflux/consumers/notifiers can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/notifiers uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/notifiers uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/consumers/notifiers, while a change to com/MainfluxLabs/mainflux/consumers/notifiers can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/notifiers uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/consumers/notifiers uses com/MainfluxLabs/mainflux/consumers, so a change to com/MainfluxLabs/mainflux/consumers can break com/MainfluxLabs/mainflux/consumers/notifiers, while a change to com/MainfluxLabs/mainflux/consumers/notifiers can't break com/MainfluxLabs/mainflux/consumers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/consumers/notifiers uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/rules uses com/MainfluxLabs/mainflux/consumers, so a change to com/MainfluxLabs/mainflux/consumers can break com/MainfluxLabs/mainflux/rules, while a change to com/MainfluxLabs/mainflux/rules can't break com/MainfluxLabs/mainflux/consumers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/rules uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/shadows uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/shadows, while a change to com/MainfluxLabs/mainflux/shadows can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/shadows uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/shadows, while a change to com/MainfluxLabs/mainflux/shadows can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/shadows uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/shadows, while a change to com/MainfluxLabs/mainflux/shadows can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/shadows uses com/MainfluxLabs/mainflux/consumers, so a change to com/MainfluxLabs/mainflux/consumers can break com/MainfluxLabs/mainflux/shadows, while a change to com/MainfluxLabs/mainflux/shadows can't break com/MainfluxLabs/mainflux/consumers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/webhooks uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/webhooks, while a change to com/MainfluxLabs/mainflux/webhooks can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/webhooks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/webhooks uses com/MainfluxLabs/mainflux/pkg/errors, so a change to com/MainfluxLabs/mainflux/pkg/errors can break com/MainfluxLabs/mainflux/webhooks, while a change to com/MainfluxLabs/mainflux/webhooks can't break com/MainfluxLabs/mainflux/pkg/errors.
Position
Below the diagonal: com/MainfluxLabs/mainflux/webhooks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/webhooks uses com/MainfluxLabs/mainflux/pkg/uuid, so a change to com/MainfluxLabs/mainflux/pkg/uuid can break com/MainfluxLabs/mainflux/webhooks, while a change to com/MainfluxLabs/mainflux/webhooks can't break com/MainfluxLabs/mainflux/pkg/uuid.
Position
Below the diagonal: com/MainfluxLabs/mainflux/webhooks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/webhooks uses com/MainfluxLabs/mainflux/consumers, so a change to com/MainfluxLabs/mainflux/consumers can break com/MainfluxLabs/mainflux/webhooks, while a change to com/MainfluxLabs/mainflux/webhooks can't break com/MainfluxLabs/mainflux/consumers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/webhooks uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/shadows uses com/MainfluxLabs/mainflux/shadows, so a change to com/MainfluxLabs/mainflux/shadows can break com/MainfluxLabs/mainflux/cmd/shadows, while a change to com/MainfluxLabs/mainflux/cmd/shadows can't break com/MainfluxLabs/mainflux/shadows.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/shadows uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smpp-notifier uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/smpp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smpp-notifier can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smpp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smpp-notifier uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/smpp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smpp-notifier can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smpp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smpp-notifier uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/smpp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smpp-notifier can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smpp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smpp-notifier uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/smpp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smpp-notifier can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smpp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smpp-notifier uses com/MainfluxLabs/mainflux/consumers/notifiers, so a change to com/MainfluxLabs/mainflux/consumers/notifiers can break com/MainfluxLabs/mainflux/cmd/smpp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smpp-notifier can't break com/MainfluxLabs/mainflux/consumers/notifiers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smpp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/pkg/clients, so a change to com/MainfluxLabs/mainflux/pkg/clients can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/pkg/clients.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/pkg/servers, so a change to com/MainfluxLabs/mainflux/pkg/servers can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/pkg/servers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/pkg/email, so a change to com/MainfluxLabs/mainflux/pkg/email can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/pkg/email.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/cmd/smtp-notifier uses com/MainfluxLabs/mainflux/consumers/notifiers, so a change to com/MainfluxLabs/mainflux/consumers/notifiers can break com/MainfluxLabs/mainflux/cmd/smtp-notifier, while a change to com/MainfluxLabs/mainflux/cmd/smtp-notifier can't break com/MainfluxLabs/mainflux/consumers/notifiers.
Position
Below the diagonal: com/MainfluxLabs/mainflux/cmd/smtp-notifier uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging/nats uses com/MainfluxLabs/mainflux/logger, so a change to com/MainfluxLabs/mainflux/logger can break com/MainfluxLabs/mainflux/pkg/messaging/nats, while a change to com/MainfluxLabs/mainflux/pkg/messaging/nats can't break com/MainfluxLabs/mainflux/logger.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging/nats uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging/nats uses com/MainfluxLabs/mainflux/pkg/domain, so a change to com/MainfluxLabs/mainflux/pkg/domain can break com/MainfluxLabs/mainflux/pkg/messaging/nats, while a change to com/MainfluxLabs/mainflux/pkg/messaging/nats can't break com/MainfluxLabs/mainflux/pkg/domain.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging/nats uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging/nats uses com/MainfluxLabs/mainflux/pkg/messaging, so a change to com/MainfluxLabs/mainflux/pkg/messaging can break com/MainfluxLabs/mainflux/pkg/messaging/nats, while a change to com/MainfluxLabs/mainflux/pkg/messaging/nats can't break com/MainfluxLabs/mainflux/pkg/messaging.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging/nats uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging/nats uses com/MainfluxLabs/mainflux/mqtt, so a change to com/MainfluxLabs/mainflux/mqtt can break com/MainfluxLabs/mainflux/pkg/messaging/nats, while a change to com/MainfluxLabs/mainflux/pkg/messaging/nats can't break com/MainfluxLabs/mainflux/mqtt.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging/nats uses a module listed above it, which is the healthy direction.
com/MainfluxLabs/mainflux/pkg/messaging/nats uses com/MainfluxLabs/mainflux/rules, so a change to com/MainfluxLabs/mainflux/rules can break com/MainfluxLabs/mainflux/pkg/messaging/nats, while a change to com/MainfluxLabs/mainflux/pkg/messaging/nats can't break com/MainfluxLabs/mainflux/rules.
Position
Below the diagonal: com/MainfluxLabs/mainflux/pkg/messaging/nats uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 46.3 · Weak · gated by D4, X4 ·
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
104
High / Critical
A02:2025 — Security Misconfiguration
34
High / Critical
A07:2025 — Authentication Failures
22
High / Critical
A03:2025 — Software Supply Chain Failures
14
High / Critical
Roadmap
Top priorities: Interpolated log message defeats structured logging; Thread a context.Context through functions that make requests, so the work stops when its caller gives up; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Bring the 14 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with converters.toSenMLEntries (cyclomatic 26), converters.parseJSONRecord (cyclomatic 26), messages.ConvertCSVToSenMLMessages (cyclomatic 24).
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 — 51
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 — 1316
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 — 220
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 14
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 64 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, the weighted average across measured dimensions.
Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.
What we checked — 64 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, 1491 of 1587 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D26 Project Cohesion — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `(repository root)` (84059 LoC, 564 module-visible types across 210 directories) is over its size bounds, and whether one unit is a coherent whole or a grab-bag is read from its type references: the parts of it that reach the rest only through its shared core. Those are read over the C#/VB code model, which this unit's source did not supply. Its size alone is no verdict on its cohesion, so none is published.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `modbus/codec.go` 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.
AXI1 Runtime container hardening — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 4 further occurrence(s) are not listed individually; the score already reflects all 44.
AXS1 Runtime exposed surface — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
DM8 Value-object opportunities — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Go is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Go 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
P8 Schema migrations — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 44 further occurrence(s) are not listed individually; the score already reflects all 84.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 19 further occurrence(s) are not listed individually; the score already reflects all 59.
X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 636 further occurrence(s) are not listed individually; the score already reflects all 676.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 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 checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D22 Internal API Consistency: API consistency compares the call shapes of members that play the same role on the exposed C# surface: whether the API suits its callers is not measured, and surfaces in other languages are not measured.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
DM4 Rich vs anemic 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
14 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was converters.toSenMLEntries at 26. A further 3 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 downlinks.TimeLayout at 18 — they are counted neither in the figure above nor in this dimension's score. 3 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: downlinks/format.go (downlinks.TimeLayout at 18), pkg/apiutil/transport.go (apiutil.EncodeGRPCError at 18), pkg/transformers/json/time.go (json.parseTime at 18). 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.
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 14 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with converters.toSenMLEntries (cyclomatic 26), converters.parseJSONRecord (cyclomatic 26), messages.ConvertCSVToSenMLMessages (cyclomatic 24). — 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 14 together lifts Cyclomatic Complexity from 8.3 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.
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.
+ 38 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 30 down to 30 or less in Cognitive Complexity — start with converters.parseJSONRecord (cognitive 59), converters.toSenMLEntries (cognitive 45), adapterService.PublishSenMLMessagesFromCSV (cognitive 38). — 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 8 together lifts Cognitive Complexity from 6.6 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes9.0 / 10Stronggated by 25 serious findings✓ 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.
Resolve the 10 TooManyMethods finding(s) in God Classes — start with service.go (3), logging.go (3), metrics.go (3). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 6 FunctionTooLong finding(s) in God Classes — start with transport.go (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 FileTooLong finding(s) in God Classes — start with service.go (2), logging.go, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
380 duplicated block group(s) detected. 29.4 % of the production lines (24,644 of 83,917) are in a reported copy. A further 345 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.
+ 261 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 28 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with logging.go (5), transport.go (3), REDACTED (3). — One of this dimension's main actionable groups (28 warning-level).
Resolve the 25 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with transport.go (6), REDACTED (3), invites.go (2). — One of this dimension's main actionable groups (25 warning-level).
Resolve the 23 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (7), logging.go (4), transport.go (3). — One of this dimension's main actionable groups (23 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with server.go (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage8.1 / 10Strong✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 44.3% — 295 file(s) below 50%. Measured from the Go suite (github.com/MainfluxLabs/mainflux: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it. 6 line(s) in 1 file(s) were executed in some runs and not in others, so they are not counted.
Tests reach code only in some runs: pkg/events/publisher.gopkg/events/publisher.go:218
What to do
Resolve the 295 Low coverage finding(s) in Code Coverage — start with REDACTED (27), logging.go (24), metrics.go (24). — One of this dimension's main actionable groups (295 warning-level).
Resolve the 1 Tests reach code only in some runs finding(s) in Code Coverage — start with publisher.go. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests pass reliably, with no flakiness.
Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
23 outdated, 1 author-deprecated direct Go module(s), 4 pinning or checksum defect(s). 47 of 47 direct requirement(s) were graded against proxy.golang.org (0 not served there, 6 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.
Dependency pinned to a stale untagged commit: github.com/fiorix/go-smpp · ×4
Deprecated module: github.com/golang/protobuf
Outdated: github.com/cenkalti/backoff/v4 · ×23
What to do
Resolve the 4 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Deprecated module finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
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 5 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
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 111 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 4 Hotspot finding(s) in Churn × Complexity Hotspots — start with service.go, transport.go, REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
20 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is auth/invites.go. Counted over 386 of the 660 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 · ×3
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.
0 deducted task-comment markers across 83917 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 54 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
4 naming inconsistencies among 1110 declarations measured against a convention their peers follow.
`authHttpConfig` spells `Http` where 40 names in the project spell it `HTTP`cmd/things/main.go:138
`GetThingId` spells `Id` where 1654 names in the project spell it `ID`readers/api/grpc/server.go:68
`OperatorAND` spells `AND` where 29 names in the project spell it `And`rules/rules.go:64
`ErrInvalidUrl` spells `Url` where 193 names in the project spell it `URL`webhooks/api/http/requests.go:21
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D22 · Internal API Consistency9.8 / 10Stronggated by 3 serious findings✓ Tool-verified
What it measures: Whether the internal API surface is consistent and coherent.
Method: Call-shape rules (A1-A9) over the structured code model of the intentionally exposed C# surface: members of one type, overloads of one name and the same slot across sibling types are compared, and a member that makes a caller use a different convention for the same kind of operation is flagged. Deterministic, no model. Advisory.
3 API inconsistencies among 1493 exposed members measured against a convention their peers follow.
`Service.RemoveObserver` takes no context.Context; its 5 sibling operations take onecoap/adapter.go:36
`messages.Flatten` returns a map (`map[K]V`) where its 8 siblings return a slice (`[]T`)readers/api/http/messages/converters.go:182
`Service.OAuthLogin` takes no context.Context; its 25 sibling operations take oneusers/service.go:106
What to do
Resolve the 1 `Service.RemoveObserver` takes no context.Context; its 5 sibling… finding(s) in Internal API Consistency — start with adapter.go. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `messages.Flatten` returns a map (`map[K]V`) where its 8 siblings return… finding(s) in Internal API Consistency — start with converters.go. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `Service.OAuthLogin` takes no context.Context; its 25 sibling operations… finding(s) in Internal API Consistency — start with service.go. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability5.2 / 10Adequate✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
73 % of calls cross a namespace and 38 % go through an interface, but 22 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.
High interface indirection
Scattered collaborators
What to do
Resolve the 1 High interface indirection finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d27_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.
16 finding(s): 0 critical, 16 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 16 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (16 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).
105 finding(s): 0 critical, 10 high, 15 medium, 80 low. 8 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 1 file(s) — `modbus/codec.go` (line 138) — 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 1 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
+ 11 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
No action in Static Analysis (SAST) — all 8 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 (8 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 32 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (29), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (32 warning-level).
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-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.
28 of 386 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is cmd/audit/main.go. Counted over 386 of the 660 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned file · ×28cmd/audit/main.go:1
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with things.go, publisher.go. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 3 Change coupling finding(s) in Change Coupling — start with endpoint.go, transport.go, requests.go. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`AuthClient` declares 20 methods: `Issue`, `IssueImpersonated`, `RefreshToken`, `RevokeSessions`, `RevokeAPIKeys`, `Identify`, `IdentifyRecovery`, `Authorize`, `GetOwnerIDByOrg`, `AssignRole`, `RetrieveRole`, `RetrieveRoles`, `UnassignRole`, `CreateDormantOrgInvite`, `ActivateOrgInvite`, `GetDormantOrgInviteByPlatformInvite`, `ViewOrg`, `GetAdminsByOrg`, `GetOrgIDsByAdmin`, `GetOrgMembership`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — pkg/domain/auth.go:161
`ThingsClient` declares 18 methods: `GetPubConfigByKey`, `GetConfigByThing`, `CanUserAccessThing`, `CanUserAccessThings`, `CanUserAccessProfile`, `CanUserAccessGroup`, `CanThingAccessGroup`, `CanThingCommand`, `CanThingGroupCommand`, `Identify`, `GetGroupIDByThing`, `GetGroupIDByProfile`, `GetGroupIDsByOrg`, `GetThingIDsByProfile`, `CreateGroupMemberships`, `RemoveGroupMembershipsByOrg`, `GetGroup`, `GetKeyByThingID`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — pkg/domain/things.go:163
`SDK` declares 85 methods: `CreateUser`, `GetUser`, `ListUsers`, `CreateToken`, `RegisterUser`, `UpdateUser`, `UpdatePassword`, `CreateThing`, `CreateThings`, `ListThings`, `ListThingsByProfile`, `GetThing`, `GetThingMetadataByKey`, `UpdateThing`, `DeleteThing`, `DeleteThings`, `IdentifyThing`, `UpdateExternalThingKey`, `CreateGroup`, `DeleteGroup`, `DeleteGroups`, `ListGroups`, `ListGroupsByOrg`, `GetGroup`, `ListThingsByGroup`, `GetGroupByThing`, `UpdateGroup`, `CreateProfile`, `CreateProfiles`, `ListProfiles`, `GetProfileByThing`, `GetProfile`, `UpdateProfile`, `DeleteProfile`, `DeleteProfiles`, `ListProfilesByGroup`, `GetGroupByProfile`, `CreateGroupMemberships`, `UpdateGroupMemberships`, `RemoveGroupMemberships`, and 45 more. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — REDACTED:223
`Service` declares 39 methods: `CreateThings`, `UpdateThing`, `UpdateThingGroupAndProfile`, `UpdateThingsMetadata`, `ViewThing`, `ListThings`, `ListThingsByOrg`, `ListThingsByProfile`, `RemoveThings`, `CreateProfiles`, `UpdateProfile`, `ViewProfile`, `ListProfiles`, `ListProfilesByOrg`, `ViewProfileByThing`, `ViewMetadataByKey`, `RemoveProfiles`, `GetPubConfigByKey`, `GetConfigByThing`, `CanUserAccessThing`, `CanUserAccessThings`, `CanUserAccessProfile`, `CanUserAccessGroup`, `CanThingAccessGroup`, `CanThingCommand`, `CanThingGroupCommand`, `Identify`, `GetKeyByThingID`, `GetGroupIDByThing`, `GetGroupIDByProfile`, `GetOrgIDByGroup`, `GetGroupIDsByOrg`, `UpdateExternalKey`, `RemoveExternalKey`, `Backup`, `Restore`, `GetThingIDsByProfile`, `GetThingIDsByGroup`, `GetGroupIDsByOrgInternal`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — things/service.go:45
`Service` declares 18 methods: `ViewOrgConfig`, `ListOrgsConfigs`, `UpdateOrgConfig`, `RemoveOrgConfig`, `BackupOrgsConfigs`, `ViewThingConfig`, `ListThingsConfigs`, `UpdateThingConfig`, `RemoveThingConfig`, `RemoveThingConfigByGroup`, `BackupThingsConfigs`, `ViewGroupConfig`, `ListGroupsConfigs`, `UpdateGroupConfig`, `RemoveGroupConfig`, `BackupGroupsConfigs`, `Backup`, `Restore`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — uiconfigs/service.go:24
`Service` declares 26 methods: `SelfRegister`, `VerifyEmail`, `RegisterByInvite`, `Register`, `RegisterAdmin`, `Login`, `RefreshToken`, `OAuthLogin`, `OAuthCallback`, `ViewUser`, `ViewProfile`, `ListUsers`, `ListUsersByIDs`, `ListUsersByEmails`, `UpdateUser`, `GenerateResetToken`, `ChangePassword`, `ResetPassword`, `SendPasswordReset`, `EnableUser`, `DisableUser`, `Impersonate`, `AssignAdminRole`, `UnassignAdminRole`, `Backup`, `Restore`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — users/service.go:68
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Do you agree with this assessment?
DM10 · One transaction, one aggregate9.5 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.
Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.
`service.CreateOrg` saves `OrgRepository`, `OrgMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — auth/orgs.go:88
`service.Restore` saves `OrgRepository`, `OrgMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — auth/service.go:268
`filestoreService.RemoveFile` saves `FileStore`, `ThingsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — filestore/service.go:240
`filestoreService.RemoveGroupFile` saves `FileStore`, `GroupsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — filestore/service.go:334
`thingsService.CreateGroups` saves `GroupRepository`, `GroupMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — things/groups.go:121
`thingsService.Restore` saves `GroupRepository`, `ProfileRepository`, `ThingRepository`, `GroupMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — things/service.go:870
`configService.Restore` saves `OrgConfigRepository`, `ThingConfigRepository`, `GroupConfigRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — uiconfigs/service.go:333
`usersService.SelfRegister` saves `UserRepository`, `EmailVerificationRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — users/service.go:233
`usersService.VerifyEmail` saves `EmailVerificationRepository`, `UserRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — users/service.go:348
`usersService.handleIdentity` saves `UserRepository`, `IdentityRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — users/service.go:646
`usersService.Restore` saves `UserRepository`, `IdentityRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event. — users/service.go:852
What to do
Mutate one aggregate per operation and let the others follow from a domain event — the second aggregate reaching consistency a moment later is the design, not a compromise.
Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
Do you agree with this assessment?
DM12 · Ambient inputs in the domain10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly — an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.
Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads — DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp — resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.
Do you agree with this assessment?
DM4 · Rich vs anemic model4.4 / 10Weak✓ Tool-verified
Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
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.
`RevokedCert` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — certs/certs.go:26
`Command` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/transformers/json/command.go:11
`Message` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/transformers/json/message.go:13
`Message` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service. — pkg/transformers/senml/message.go:4
What to do
Move business rules onto the aggregates/entities they govern so invariants are enforced at the source, not in anemic services.
Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.
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 (EF/Marten/HTTP/ASP.NET) — 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.
Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.
Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.
Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
Other · Event-Driven — Whether event handlers stay asynchronous (no blocking remote HTTP/gRPC calls awaited inside a handler).
Method: Roslyn semantic scan (event-driven gated): event-handler bodies scanned for HTTP/gRPC invocations by resolved symbol type, not substring. Deterministic, semantic-resolved.
Other · Event-Driven — Whether commands have a single handler (one owner of the decision) and fan-out is modelled with events.
Method: Roslyn scan (event-driven gated): command-shaped messages identified by convention; handler count per command checked for the exactly-one rule. Deterministic, hard fact.
Other · Event-Driven — Whether events are named in the past tense (a clarity nudge — low weight).
Method: Roslyn scan (event-driven gated): domain and integration events checked for past-tense naming (-ed/-en suffix or irregular set). Naming nudge, low-weight advisory.
`redisEvent` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe. — pkg/events/redis.go:58
What to do
Name new events in the past tense: they record facts that already happened. Do not rename an event that is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
`eventStore.CreateOrg` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — auth/redis/streams.go:44
`eventStore.RemoveOrgs` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — auth/redis/streams.go:58
`eventStore.CreateThings` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:25
`eventStore.UpdateThing` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:53
`eventStore.UpdateThingGroupAndProfile` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:82
`eventStore.RemoveThings` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:111
`eventStore.CreateProfiles` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:147
`eventStore.UpdateProfile` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:174
`eventStore.RemoveProfiles` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:203
`eventStore.RemoveGroups` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:229
`eventStore.RemoveGroupsByOrg` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem). — things/redis/events/streams.go:254
What to do
Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
.github/workflows/README.md names Go 1.25, but REDACTED:3 requires `go 1.26.0`: the code does not build on Go 1.25. 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. — .github/workflows/README.md:22
consumers/writers/README.md links to `../REDACTED`, but `consumers/REDACTED` 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. — consumers/writers/README.md:10
What to do
Reconcile the README with reality: .github/workflows/README.md names Go 1.25, but REDACTED:3 requires `go 1.26.0`: the code does not build on Go 1.25; consumers/writers/README.md links to `../REDACTED`, but `consumers/REDACTED` does not exist.
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
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
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.
`http.Get(` 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. — cmd/mqtt/main.go:413
`http.Client{` 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. — REDACTED:520
What to do
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Do you agree with this assessment?
P9 · Domain vs controller coverage10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — Whether test coverage concentrates on the domain (business rules) rather than the trivial web/controller layer — a focus check a generic tool can't make.
Method: Roslyn plus test-execution analysis: domain-layer versus trivial web/controller coverage ratio. Computed metric, 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.
A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — users/argon2/hasher_test.go
What to do
Call b.ReportAllocs() in the benchmarks, or run them with `go test -bench . -benchmem`, so allocation regressions are visible, not just time.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
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.
Set: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy — 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. (−0.5 on this card.) — REDACTED:36
What to do
Add Content-Security-Policy beside the headers already set; Content-Security-Policy is the one that pays for itself first, then Strict-Transport-Security, then nosniff and a frame policy.
Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (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 5/88 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`IssueCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:43
`ViewCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:81
`RevokeCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:110
`RenewCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:136
`ListSerials` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:166
`RemoveCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/certs.go:197
`CreateGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/group_memberships.go:13
`UpdateGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/group_memberships.go:39
`RemoveGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/group_memberships.go:63
`ListGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/group_memberships.go:89
`CreateGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:33
`DeleteGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:69
`DeleteGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:88
`ListThingsByGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:114
`ListProfilesByGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:144
`getGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:192
`GetGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:220
`UpdateGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:250
`GetGroupByThing` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:274
`GetGroupByProfile` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/groups.go:304
`CreateInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/invites.go:20
`RevokeInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/invites.go:63
`InviteRespond` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/invites.go:82
`GetInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/invites.go:109
`ListInvitesByUser` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/invites.go:136
`Issue` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/keys.go:30
`Revoke` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/keys.go:67
`RetrieveKey` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/keys.go:86
`SendMessage` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:22
`ReadMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:43
`ListJSONMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:71
`ListSenMLMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:95
`DeleteJSONMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:119
`DeleteSenMLMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:139
`DeleteAllJSONMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:159
`DeleteAllSenMLMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:179
`ExportJSONMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:199
`ExportSenMLMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:237
`BackupMessages` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/sdk/go/messages.go:275
What to do
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for … range` leaves the slice or map it is walking alone — Go raises nothing, but the walk and the collection part: a range evaluates its slice once, so an element appended in the body is never visited and a removal by reslicing (`s = append(s[:i], s[i+1:]...)`, `slices.Delete`) shifts the next element under the index, which is then skipped while the last is read twice; a reslice, a reassignment or a sort leaves every later `s[i]` naming another element; and a map's order is unspecified, so deleting another key (or clearing the map) changes from run to run which entries the loop still sees.
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.
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.
`svc.Publish(context.Background(), req.ThingKey, buildMessage(req.subtopic, payload))` returns an error, and the statement drops it: when `svc.Publish` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.Publish(context.Background(), req.ThingKey, buildMessage(req.subtopic, payload)); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:95
`svc.SendCommandToThing(context.Background(), req.token, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToThing` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToThing(context.Background(), req.token, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:107
`svc.SendCommandToThingByKey(context.Background(), req.thingKey, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToThingByKey` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToThingByKey(context.Background(), req.thingKey, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:109
`svc.SendCommandToGroup(context.Background(), req.token, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToGroup` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToGroup(context.Background(), req.token, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:120
`svc.SendCommandToGroupByKey(context.Background(), req.thingKey, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToGroupByKey` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToGroupByKey(context.Background(), req.thingKey, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:122
`case pgerrcode.StringDataRightTruncationDataException` handles a failure of `pgErr` but reports `err`, which the earlier `if err != nil { return … }` already proved nil here: the real failure is lost and a nil error is reported (or returned as success) in its place. Report `pgErr`. (×2) — webhooks/postgres/webhooks.go:165, things/postgres/things.go:432
`svc.SendPlatformInviteEmail(ctx, invite, redirectPath)` returns an error, and the statement drops it: when `svc.SendPlatformInviteEmail` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendPlatformInviteEmail(ctx, invite, redirectPath); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — users/invites.go:121
`svc.emailVerifications.Remove(ctx, token)` returns an error, and the statement drops it: when `svc.emailVerifications.Remove` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.emailVerifications.Remove(ctx, token); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — users/service.go:294
`svc.SendPasswordReset(ctx, redirectPath, email, t)` returns an error, and the statement drops it: when `svc.SendPasswordReset` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendPasswordReset(ctx, redirectPath, email, t); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — users/service.go:904
`errors.Wrap(dbutil.ErrCreateEntity, err)` returns an error, and the statement drops it: when `errors.Wrap` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := errors.Wrap(dbutil.ErrCreateEntity, err); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — users/postgres/invites.go:33
`if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×13) — REDACTED:133, REDACTED:148, things/service.go:1003, …
`ts.email.SendGroupMembershipNotification([]string{recipientEmail}, org.Name, group.Name, gm.Role, redirectPath)` returns an error, and the statement drops it: when `ts.email.SendGroupMembershipNotification` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ts.email.SendGroupMembershipNotification([]string{recipientEmail}, org.Name, group.Name, gm.Role, redirectPath); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter. — REDACTED:162
`if groupErr != nil` handles a failure of `groupErr` but reports `err`, which the earlier `if err != nil { return … }` already proved nil here: the real failure is lost and a nil error is reported (or returned as success) in its place. Report `groupErr`. — things/service.go:960
`n, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `n` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — things/api/http/groups/transport.go:198
`m, _ := apiutil.ReadMetadataQuery(r, apiutil.MetadataKey, nil)` writes the call's error to `_` and then uses `m` as if the call succeeded. When `apiutil.ReadMetadataQuery` fails, `m` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `m` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — things/api/http/groups/transport.go:199
`if err := json.Unmarshal(record.Payload, &recordState); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — shadows/service.go:186
`name, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `name` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `name` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `name` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×3) — rules/api/http/scripts/transport.go:132, rules/api/http/rules/transport.go:151, rules/api/http/rules/transport.go:175
`inputType, _ := apiutil.ReadStringQuery(r, apiutil.InputTypeKey, "")` writes the call's error to `_` and then uses `inputType` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `inputType` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `inputType` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — rules/api/http/rules/transport.go:152, rules/api/http/rules/transport.go:176
`escaped, _ := escapeFieldName(parts[0])` writes the call's error to `_` and then uses `escaped` as if the call succeeded. When `escapeFieldName` fails, `escaped` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `escaped` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — readers/timescale/aggregations.go:414
`escaped, _ := escapeFieldName(part)` writes the call's error to `_` and then uses `escaped` as if the call succeeded. When `escapeFieldName` fails, `escaped` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `escaped` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — readers/timescale/aggregations.go:421
`jsonMsg, ok := msg.(mfjson.Message)` failed on this branch, so `jsonMsg` is the zero value of `mfjson.Message` here, and that is what is reported: the value that did not fit is lost. Report `msg` itself (and `%T` of it) instead. — readers/timescale/json.go:92
`if err := json.Unmarshal(record.GetPayload(), &sm); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — readers/api/grpc/client.go:157
`quotedName, _ := json.Marshal(name)` writes the call's error to `_` and then uses `quotedName` as if the call succeeded. When `json.Marshal` fails, `quotedName` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `quotedName` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — pkg/readers/query.go:151
`if err := json.Unmarshal(payload, &claims); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/authn/decode.go:29
What to do
Discarded error (an error-returning call as a bare statement)
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.
`Warn` at line 26 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — REDACTED:26, users/emailer/logging.go:26
`Warn` at line 63 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — REDACTED:63
`Debug` at line 78 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Debug("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Debug("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Debug("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — REDACTED:78
`Warn` at line 84 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — REDACTED:84
`Warn` at line 40 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — ws/api/logging.go:40, users/emailer/logging.go:40
`Info` at line 43 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:43
`Warn` at line 53 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:53
`Info` at line 56 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:56
`Warn` at line 66 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — ws/api/logging.go:66, webhooks/api/logging.go:66
`Info` at line 69 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — ws/api/logging.go:69, webhooks/api/logging.go:69
`Warn` at line 80 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — ws/api/logging.go:80, webhooks/api/logging.go:80
`Info` at line 83 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — ws/api/logging.go:83, webhooks/api/logging.go:83
`Warn` at line 93 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:93
`Info` at line 96 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:96
`Warn` at line 107 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:107
`Info` at line 110 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:110
`Warn` at line 120 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:120
`Info` at line 123 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — ws/api/logging.go:123
`Warn` at line 38 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:38
`Info` at line 41 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:41
`Warn` at line 52 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:52
`Info` at line 55 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:55
`Warn` at line 94 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:94
`Info` at line 97 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:97
`Warn` at line 108 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:108
`Info` at line 111 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:111
`Warn` at line 121 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:121
`Info` at line 124 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:124
`Warn` at line 134 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:134
`Info` at line 137 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:137
`Warn` at line 147 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:147
`Info` at line 150 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — webhooks/api/logging.go:150
`Warn` at line 1014 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — users/service.go:1014
`Info` at line 29 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — users/emailer/logging.go:29
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 — 6 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.
AXH1 Runtime security headers — 8 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXI1 Runtime container hardening — 19 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility (rendered) — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXS1 Runtime exposed surface — 22 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 11 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 — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 62 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXA1 Runtime unauthenticated reachability — This run crawled public routes only — it had no logged-in session, so there is no authenticated surface to compare anonymous access against and nothing was measured. This is a statement about this run, not about your application: nothing here says access control is missing, and nothing here says it is present.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~53482 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
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.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (audit), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .go source were not judged.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 could not read how the parts of this repository's one build unit reference each other, so its cohesion was not measured. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
D5 Coupling — Not applicable — this Go build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (5 Go aggregate(s) recording domain events (own events-slice append / raise-record))
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — sql-migrate is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — go (83,917 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — go (83,917 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — 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 applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Go's type system has no nullable and non-nullable types — every pointer, map, slice and interface is nil-able at every position, there is no switch that turns null checking on, and the compiler produces no nullability warning for an operator to silence. Plain JavaScript carries no type annotations and commits no tsconfig, so it states no null-typed discipline for this check to grade: there is nothing here that switches null checking on or off, and TypeScript (or `// @ts-check`) is how a repository acquires one — advice, not a defect this card measures. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Dual write (no outbox): eventStore.CreateOrg auth/redis/streams.go:44— `eventStore.CreateOrg` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.RemoveOrgs auth/redis/streams.go:58— `eventStore.RemoveOrgs` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.CreateThings things/redis/events/streams.go:25— `eventStore.CreateThings` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.UpdateThing things/redis/events/streams.go:53— `eventStore.UpdateThing` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.UpdateThingGroupAndProfile things/redis/events/streams.go:82— `eventStore.UpdateThingGroupAndProfile` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.RemoveThings things/redis/events/streams.go:111— `eventStore.RemoveThings` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.CreateProfiles things/redis/events/streams.go:147— `eventStore.CreateProfiles` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.UpdateProfile things/redis/events/streams.go:174— `eventStore.UpdateProfile` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.RemoveProfiles things/redis/events/streams.go:203— `eventStore.RemoveProfiles` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.RemoveGroups things/redis/events/streams.go:229— `eventStore.RemoveGroups` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Dual write (no outbox): eventStore.RemoveGroupsByOrg things/redis/events/streams.go:254— `eventStore.RemoveGroupsByOrg` writes to the database AND publishes to the message bus in the same flow, with no outbox referenced in this path. These two writes aren't atomic — a crash between them either loses the message (DB committed, publish failed) or emits a phantom event (publish succeeded, DB rolled back). Use the transactional outbox pattern — write the message to an outbox table in the SAME transaction as the state change, and dispatch it from there afterwards — or your platform's equivalent (a broker transaction, or an outbox library from your own ecosystem).
Boundary-crossing change coupling: things.go ↔ transport.go pkg/sdk/go/things.go:1— `pkg/sdk/go/things.go` (context pkg) and `things/api/http/transport.go` (context things) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `874d3d3a` MF-596 - Refactor retrieve helper methods (#597); `629c2572` NOISSUE - Remove list disconn thing and channels methods (#458); `d53804e9` MF-283 - Add remove by list functionality for Things. (#300) (at that commit the file was still `things/api/things/http/transport.go`) — run `git show` on any of them.
Boundary-crossing change coupling: publisher.go ↔ profiles.go pkg/messaging/nats/publisher.go:1— `pkg/messaging/nats/publisher.go` (context pkg) and `things/profiles.go` (context things) sit in DIFFERENT parts of the tree yet change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `5d4569a6` MF-840 - Remove write flag from profile config (#845); `86286581` MF-620 - Change Config Rule to Rules; `b8b4b97e` MF-620 - Add Actions in Rule and move notifier IDs from Config root — run `git show` on any of them.
Low coverage: audit/api/http/endpoint.go audit/api/http/endpoint.go:1— 0.0% line coverage (0/52).
Low coverage: audit/api/http/requests.go audit/api/http/requests.go:1— 0.0% line coverage (0/22).
Low coverage: audit/api/http/responses.go audit/api/http/responses.go:1— 0.0% line coverage (0/6).
Low coverage: audit/api/http/transport.go audit/api/http/transport.go:1— 0.0% line coverage (0/126).
Low coverage: audit/api/logging.go audit/api/logging.go:1— 0.0% line coverage (0/37).
Low coverage: audit/api/metrics.go audit/api/metrics.go:1— 0.0% line coverage (0/25).
Low coverage: audit/events/handler.go audit/events/handler.go:1— 0.0% line coverage (0/4).
Low coverage: audit/mocks/events.go audit/mocks/events.go:1— 0.0% line coverage (0/102).
Low coverage: audit/postgres/events.go audit/postgres/events.go:1— 0.0% line coverage (0/206).
Low coverage: audit/postgres/init.go audit/postgres/init.go:1— 0.0% line coverage (0/56).
Low coverage: audit/service.go audit/service.go:1— 0.0% line coverage (0/47).
Low coverage: audit/tracing/tracing.go audit/tracing/tracing.go:1— 0.0% line coverage (0/24).
Low coverage: auth/api/http/sessions/endpoint.go auth/api/http/sessions/endpoint.go:1— 11.1% line coverage (2/18).
Low coverage: auth/api/http/sessions/requests.go auth/api/http/sessions/requests.go:1— 0.0% line coverage (0/4).
Low coverage: auth/api/logging.go auth/api/logging.go:1— 0.0% line coverage (0/378).
Low coverage: auth/api/metrics.go auth/api/metrics.go:1— 0.0% line coverage (0/215).
Low coverage: auth/emailer/emailer.go auth/emailer/emailer.go:1— 0.0% line coverage (0/23).
Low coverage: auth/emailer/logging.go auth/emailer/logging.go:1— 0.0% line coverage (0/10).
Low coverage: auth/emailer/metrics.go auth/emailer/metrics.go:1— 0.0% line coverage (0/10).
Low coverage: auth/invites.go auth/invites.go:1— 48.6% line coverage (140/288).
Low coverage: auth/postgres/invites.go auth/postgres/invites.go:1— 49.3% line coverage (217/440).
Low coverage: auth/tracing/invites.go auth/tracing/invites.go:1— 0.0% line coverage (0/58).
Low coverage: auth/tracing/keys.go auth/tracing/keys.go:1— 0.0% line coverage (0/34).
Low coverage: auth/tracing/memberships.go auth/tracing/memberships.go:1— 0.0% line coverage (0/52).
Low coverage: auth/tracing/orgs.go auth/tracing/orgs.go:1— 0.0% line coverage (0/46).
+ 270 more in this group — see findings.md.
X2 · Cancellation propagation· Function without context.Context · ×39
Function without context.Context: IssueCert pkg/sdk/go/certs.go:43— `IssueCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ViewCert pkg/sdk/go/certs.go:81— `ViewCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: RevokeCert pkg/sdk/go/certs.go:110— `RevokeCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: RenewCert pkg/sdk/go/certs.go:136— `RenewCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ListSerials pkg/sdk/go/certs.go:166— `ListSerials` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: RemoveCert pkg/sdk/go/certs.go:197— `RemoveCert` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: CreateGroupMemberships pkg/sdk/go/group_memberships.go:13— `CreateGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: UpdateGroupMemberships pkg/sdk/go/group_memberships.go:39— `UpdateGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: RemoveGroupMemberships pkg/sdk/go/group_memberships.go:63— `RemoveGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ListGroupMemberships pkg/sdk/go/group_memberships.go:89— `ListGroupMemberships` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: CreateGroups pkg/sdk/go/groups.go:33— `CreateGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: DeleteGroup pkg/sdk/go/groups.go:69— `DeleteGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: DeleteGroups pkg/sdk/go/groups.go:88— `DeleteGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ListThingsByGroup pkg/sdk/go/groups.go:114— `ListThingsByGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ListProfilesByGroup pkg/sdk/go/groups.go:144— `ListProfilesByGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: getGroups pkg/sdk/go/groups.go:192— `getGroups` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: GetGroup pkg/sdk/go/groups.go:220— `GetGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: UpdateGroup pkg/sdk/go/groups.go:250— `UpdateGroup` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: GetGroupByThing pkg/sdk/go/groups.go:274— `GetGroupByThing` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: GetGroupByProfile pkg/sdk/go/groups.go:304— `GetGroupByProfile` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: CreateInvite pkg/sdk/go/invites.go:20— `CreateInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: RevokeInvite pkg/sdk/go/invites.go:63— `RevokeInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: InviteRespond pkg/sdk/go/invites.go:82— `InviteRespond` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: GetInvite pkg/sdk/go/invites.go:109— `GetInvite` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: ListInvitesByUser pkg/sdk/go/invites.go:136— `ListInvitesByUser` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Duplicated block (11 lines × 2) auth/api/http/backup/transport.go:92— auth/api/http/backup/transport.go:92-102 | auth/api/http/orgs/transport.go:258-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) cmd/audit/main.go:275— cmd/audit/main.go:275-285 | cmd/uiconfigs/main.go:241-251 — `cmd/audit/main.go` and `cmd/uiconfigs/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/audit/main.go:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) cmd/downlinks/main.go:142— cmd/downlinks/main.go:142-152 | cmd/modbus/main.go:140-150 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) coap/adapter.go:171— coap/adapter.go:171-181 | http/adapter.go:91-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) coap/adapter.go:187— coap/adapter.go:187-197 | ws/adapter.go:133-143 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `coap/adapter.go:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) consumers/alarms/api/logging.go:151— consumers/alarms/api/logging.go:151-161 | rules/api/logging.go:193-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) downlinks/api/logging.go:143— downlinks/api/logging.go:143-153 | modbus/api/logging.go:182-192 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) downlinks/api/logging.go:156— downlinks/api/logging.go:156-166 | modbus/api/logging.go:195-205 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) downlinks/service.go:229— downlinks/service.go:229-239 | modbus/service.go:477-487 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/service.go:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) filestore/api/http/endpoint.go:74— filestore/api/http/endpoint.go:74-84 | filestore/api/http/endpoint.go:96-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. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/api/http/endpoint.go:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) filestore/api/http/endpoint.go:176— filestore/api/http/endpoint.go:176-186 | filestore/api/http/endpoint.go:220-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. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/api/http/endpoint.go:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) http/api/logging.go:74— http/api/logging.go:74-84 | ws/api/logging.go:90-100 — before extracting anything, compare `http/api/logging.go` and `ws/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) http/api/logging.go:87— http/api/logging.go:87-97 | ws/api/logging.go:117-127 — before extracting anything, compare `http/api/logging.go` and `ws/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) http/api/requests.go:37— http/api/requests.go:37-47 | http/api/requests.go:59-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `http/api/requests.go:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) pkg/sdk/go/users.go:39— pkg/sdk/go/users.go:39-49 | pkg/sdk/go/users.go:71-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/users.go:39` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) readers/api/http/backup/transport.go:100— readers/api/http/backup/transport.go:100-110 | readers/api/http/messages/transport.go:513-523 — `readers/api/http/backup/transport.go` and `readers/api/http/messages/transport.go` 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 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) readers/postgres/aggregations.go:387— readers/postgres/aggregations.go:387-397 | readers/timescale/aggregations.go:214-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/aggregations.go:387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) readers/postgres/init.go:31— readers/postgres/init.go:31-41 | readers/timescale/init.go:31-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/init.go:31` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) readers/postgres/json.go:144— readers/postgres/json.go:144-154 | readers/timescale/json.go:58-68 — `readers/postgres/json.go` and `readers/timescale/json.go` 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 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/json.go:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) things/api/http/backup/transport.go:66— things/api/http/backup/transport.go:66-76 | users/api/http/backup/transport.go:65-75 — before extracting anything, compare `things/api/http/backup/transport.go` and `users/api/http/backup/transport.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `things/api/http/backup/transport.go:79` calls `Header`, `Set` and `users/api/http/backup/transport.go:78` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) things/redis/profiles.go:47— things/redis/profiles.go:47-57 | things/redis/things.go:152-162 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) users/postgres/users.go:73— users/postgres/users.go:73-83 | users/postgres/users.go:93-103 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `users/postgres/users.go:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) audit/api/http/requests.go:39— audit/api/http/requests.go:39-49 | consumers/alarms/api/http/requests.go:98-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 (11 lines × 2) auth/emailer/emailer.go:19— auth/emailer/emailer.go:19-29 | things/emailer/emailer.go:19-29 — 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) auth/postgres/orgs.go:326— auth/postgres/orgs.go:326-336 | things/postgres/profiles.go:328-338 — 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) auth/api/validation.go:14— auth/api/validation.go:14-23 | things/api/validation.go:14-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/validation.go:14` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) auth/invites.go:175— auth/invites.go:175-184 | auth/invites.go:222-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) auth/memberships.go:185— auth/memberships.go:185-194 | REDACTED:229-238 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/memberships.go:185` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) auth/postgres/invites.go:207— auth/postgres/invites.go:207-216 | things/postgres/things.go:339-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) auth/roles.go:23— auth/roles.go:23-32 | pkg/domain/auth.go:191-200 — 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) certs/postgres/certs.go:119— certs/postgres/certs.go:119-128 | certs/postgres/certs.go:147-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. Read the line range as the matched WINDOW rather than a finished unit: at `certs/postgres/certs.go:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) cmd/coap/main.go:93— cmd/coap/main.go:93-102 | REDACTED:78-87 — `cmd/coap/main.go` and `REDACTED` 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 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) cmd/converters/main.go:93— cmd/converters/main.go:93-102 | cmd/http/main.go:80-89 — `cmd/converters/main.go` and `cmd/http/main.go` 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 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) coap/adapter.go:186— coap/adapter.go:186-195 | http/adapter.go:106-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) downlinks/api/http/backup/endpoint.go:80— downlinks/api/http/backup/endpoint.go:80-89 | downlinks/api/http/backup/endpoint.go:134-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/api/http/backup/endpoint.go:80` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) filestore/api/http/transport.go:217— filestore/api/http/transport.go:217-226 | filestore/api/http/transport.go:318-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) filestore/postgres/groups.go:171— filestore/postgres/groups.go:171-180 | filestore/postgres/things.go:169-178 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/postgres/groups.go:171` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) filestore/service.go:395— filestore/service.go:395-404 | filestore/service.go:414-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/service.go:395` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) http/api/transport.go:129— http/api/transport.go:129-138 | http/api/transport.go:167-176 — both copies are in the same file, so extract the block into 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) pkg/apiutil/transport.go:89— pkg/apiutil/transport.go:89-98 | pkg/apiutil/transport.go:204-213 — both copies are in the same file, so extract the block into 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) things/postgres/profiles.go:150— things/postgres/profiles.go:150-159 | things/postgres/profiles.go:242-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `things/postgres/profiles.go:241` calls `GetGroupIDsQuery` and `things/postgres/profiles.go:149` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) users/api/http/users/transport.go:580— users/api/http/users/transport.go:580-589 | users/api/http/users/transport.go:598-607 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) users/api/logging.go:338— users/api/logging.go:338-347 | users/api/logging.go:357-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `users/api/logging.go:338` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) users/postgres/users.go:112— users/postgres/users.go:112-121 | users/postgres/users.go:130-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `users/postgres/users.go:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) REDACTED:20— REDACTED:20-29 | REDACTED:57-66 — both copies are in the same file, so extract the block into 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) readers/postgres/senml.go:157— readers/postgres/senml.go:157-166 | readers/timescale/senml.go:198-207 — `readers/postgres/senml.go` and `readers/timescale/senml.go` 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 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 (10 lines × 2) uiconfigs/api/http/backup/transport.go:106— uiconfigs/api/http/backup/transport.go:106-115 | uiconfigs/api/http/orgs/transport.go:125-134 — `uiconfigs/api/http/backup/transport.go` and `uiconfigs/api/http/orgs/transport.go` 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 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 (10 lines × 2) downlinks/api/http/backup/requests.go:27— downlinks/api/http/backup/requests.go:27-36 | things/api/http/backup/requests.go:31-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) cmd/auth/main.go:179— cmd/auth/main.go:179-188 | cmd/things/main.go:177-186 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:179` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) consumers/alarms/api/http/transport.go:38— consumers/alarms/api/http/transport.go:38-47 | mqtt/api/http/transport.go: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. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/api/http/transport.go:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) auth/api/http/memberships/transport.go:90— auth/api/http/memberships/transport.go:90-98 | mqtt/api/http/transport.go:55-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) auth/api/http/orgs/transport.go:204— auth/api/http/orgs/transport.go:204-212 | things/api/http/groups/transport.go:309-317 — before extracting anything, compare `auth/api/http/orgs/transport.go` and `things/api/http/groups/transport.go` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/orgs/transport.go:204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) auth/api/logging.go:34— auth/api/logging.go:34-42 | users/api/logging.go:119-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/logging.go:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) auth/api/logging.go:161— auth/api/logging.go:161-169 | things/api/logging.go:391-399 — before extracting anything, compare `auth/api/logging.go` and `things/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/logging.go:161` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) auth/postgres/invites.go:203— auth/postgres/invites.go:203-211 | things/postgres/groups.go:115-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:203` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `things/postgres/groups.go:126` calls `Wrap` and `auth/postgres/invites.go:213` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) auth/postgres/invites.go:493— auth/postgres/invites.go:493-501 | things/postgres/things.go:338-346 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:493` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) auth/postgres/memberships.go:143— auth/postgres/memberships.go:143-151 | things/postgres/memberships.go:39-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/memberships.go:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) cmd/auth/main.go:319— cmd/auth/main.go:319-327 | cmd/things/main.go:269-277 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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 (9 lines × 2) cmd/auth/main.go:403— cmd/auth/main.go:403-411 | cmd/things/main.go:438-446 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:403` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/smpp-notifier/main.go:201— cmd/smpp-notifier/main.go:201-209 | cmd/smtp-notifier/main.go:209-217 — `cmd/smpp-notifier/main.go` and `cmd/smtp-notifier/main.go` 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 19 separate duplicated blocks between them, totalling at least 223 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) coap/api/logging.go:51— coap/api/logging.go:51-59 | ws/api/logging.go:52-60 — before extracting anything, compare `coap/api/logging.go` and `ws/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `coap/api/logging.go:51` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) downlinks/api/http/transport.go:203— downlinks/api/http/transport.go:203-211 | modbus/api/http/transport.go:346-354 — before extracting anything, compare `downlinks/api/http/transport.go` and `modbus/api/http/transport.go` as WHOLE FILES: this scan already matched 6 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. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/api/http/transport.go:203` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) downlinks/postgres/downlinks.go:74— downlinks/postgres/downlinks.go:74-82 | downlinks/postgres/downlinks.go:119-127 — both copies are in the same file, so extract the block into 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) pkg/sdk/go/certs.go:85— pkg/sdk/go/certs.go:85-94 | pkg/sdk/go/certs.go:140-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 2) rules/api/logging.go:182— rules/api/logging.go:182-190 | shadows/api/logging.go:90-98 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rules/api/logging.go:182` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) REDACTED:117— REDACTED:117-125 | REDACTED:170-178 — both copies are in the same file, so extract the block into 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) auth/api/http/invites/responses.go:24— auth/api/http/invites/responses.go:24-32 | users/api/http/invites/responses.go:98-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) cmd/mqtt/main.go:340— cmd/mqtt/main.go:340-348 | cmd/things/main.go:361-369 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/things/main.go:357` calls `Env` and `cmd/mqtt/main.go:336` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) downlinks/service.go:334— downlinks/service.go:334-342 | modbus/service.go:581-589 — 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) users/api/http/invites/responses.go:42— users/api/http/invites/responses.go:42-50 | users/api/http/users/responses.go:47-55 — 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) cmd/postgres-reader/main.go:279— cmd/postgres-reader/main.go:279-287 | cmd/timescale-reader/main.go:251-259 — `cmd/postgres-reader/main.go` and `cmd/timescale-reader/main.go` 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 135 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/postgres-reader/main.go:279` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/postgres-writer/main.go:149— cmd/postgres-writer/main.go:149-157 | cmd/timescale-writer/main.go:147-155 — `cmd/postgres-writer/main.go` and `cmd/timescale-writer/main.go` 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 97 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/postgres-writer/main.go:149` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/auth/main.go:427— cmd/auth/main.go:427-435 | cmd/things/main.go:463-471 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
AXS1 · Runtime exposed surface· Runtime opened a port the repository does not declare · ×22
Runtime opened a port the repository does not declare: alarms 9026->9026/tcp on 0.0.0.0 — The booted stack published container port 9026/tcp of service 'alarms' as host port 9026, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: audit 9030->9030/tcp on 0.0.0.0 — The booted stack published container port 9030/tcp of service 'audit' as host port 9030, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: auth 8181->8181/tcp on 0.0.0.0 — The booted stack published container port 8181/tcp of service 'auth' as host port 8181, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: auth 8189->8189/tcp on 0.0.0.0 — The booted stack published container port 8189/tcp of service 'auth' as host port 8189, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: broker 4222->4222/tcp on 0.0.0.0 — The booted stack published container port 4222/tcp of service 'broker' as host port 4222, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: certs 8204->8204/tcp on 0.0.0.0 — The booted stack published container port 8204/tcp of service 'certs' as host port 8204, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: coap-adapter 5683->5683/tcp on 0.0.0.0 — The booted stack published container port 5683/tcp of service 'coap-adapter' as host port 5683, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: coap-adapter 5683->5683/udp on 0.0.0.0 — The booted stack published container port 5683/udp of service 'coap-adapter' as host port 5683, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: coap-adapter 5684->5684/udp on 0.0.0.0 — The booted stack published container port 5684/udp of service 'coap-adapter' as host port 5684, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: converters 8195->8195/tcp on 0.0.0.0 — The booted stack published container port 8195/tcp of service 'converters' as host port 8195, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: downlinks 9025->9025/tcp on 0.0.0.0 — The booted stack published container port 9025/tcp of service 'downlinks' as host port 9025, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: filestore 9022->9022/tcp on 0.0.0.0 — The booted stack published container port 9022/tcp of service 'filestore' as host port 9022, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: http-adapter 8185->8185/tcp on 0.0.0.0 — The booted stack published container port 8185/tcp of service 'http-adapter' as host port 8185, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: jaeger 5778->5778/tcp on 0.0.0.0 — The booted stack published container port 5778/tcp of service 'jaeger' as host port 5778, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: jaeger 6831->6831/udp on :: — The booted stack published container port 6831/udp of service 'jaeger' as host port 6831, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: jaeger 14268->14268/tcp on 0.0.0.0 — The booted stack published container port 14268/tcp of service 'jaeger' as host port 14268, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: jaeger 16686->16686/tcp on :: — The booted stack published container port 16686/tcp of service 'jaeger' as host port 16686, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: modbus 9028->9028/tcp on 0.0.0.0 — The booted stack published container port 9028/tcp of service 'modbus' as host port 9028, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: mqtt-adapter 8285->8285/tcp on 0.0.0.0 — The booted stack published container port 8285/tcp of service 'mqtt-adapter' as host port 8285, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: nginx 80->80/tcp on 0.0.0.0 — The booted stack published container port 80/tcp of service 'nginx' as host port 80, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: nginx 443->443/tcp on 0.0.0.0 — The booted stack published container port 443/tcp of service 'nginx' as host port 443, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Runtime opened a port the repository does not declare: nginx 1883->1883/tcp on 0.0.0.0 — The booted stack published container port 1883/tcp of service 'nginx' as host port 1883, but no ports:/expose:/EXPOSE entry in this repository names it — so it is most likely inherited from a base image. Observed after booting the stack in our sandbox, not read from a manifest. Advisory evidence for CRA Annex I (2)(j) (limit attack surfaces, including external interfaces); we do not assess whether the network it is published onto makes this a risk.
Duplicated block (7 lines × 2) auth/postgres/memberships.go:119— auth/postgres/memberships.go:119-125 | things/postgres/memberships.go:67-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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/memberships.go:119` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) auth/postgres/orgs.go:48— auth/postgres/orgs.go:48-54 | things/postgres/groups.go:119-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) cmd/audit/main.go:141— cmd/audit/main.go:141-147 | cmd/users/main.go:199-205 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/audit/main.go:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) cmd/mqtt/main.go:213— cmd/mqtt/main.go:213-219 | cmd/timescale-reader/main.go:116-122 — `cmd/mqtt/main.go` and `cmd/timescale-reader/main.go` 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 99 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) cmd/postgres-reader/main.go:138— cmd/postgres-reader/main.go:138-144 | cmd/timescale-reader/main.go:128-134 — `cmd/postgres-reader/main.go` and `cmd/timescale-reader/main.go` 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 135 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) cmd/postgres-writer/main.go:93— cmd/postgres-writer/main.go:93-99 | cmd/timescale-writer/main.go:92-98 — `cmd/postgres-writer/main.go` and `cmd/timescale-writer/main.go` 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 97 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/postgres-writer/main.go:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) consumers/alarms/service.go:140— consumers/alarms/service.go:140-146 | uiconfigs/service.go:211-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) consumers/notifiers/service.go:194— consumers/notifiers/service.go:194-200 | webhooks/service.go:179-185 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/notifiers/service.go:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) modbus/postgres/clients.go:109— modbus/postgres/clients.go:109-115 | modbus/postgres/clients.go:159-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) mqtt/api/logging.go:48— mqtt/api/logging.go:48-54 | mqtt/api/logging.go:62-68 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `mqtt/api/logging.go:48` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) coap/api/metrics.go:45— coap/api/metrics.go:45-51 | ws/api/metrics.go:45-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) http/api/metrics.go:63— http/api/metrics.go:63-69 | ws/api/metrics.go:72-78 — before extracting anything, compare `http/api/metrics.go` and `ws/api/metrics.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) http/api/metrics.go:72— http/api/metrics.go:72-78 | ws/api/metrics.go:90-96 — before extracting anything, compare `http/api/metrics.go` and `ws/api/metrics.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) auth/tracing/roles.go:44— auth/tracing/roles.go:44-50 | things/tracing/memberships.go:46-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) REDACTED:376— REDACTED:376-382 | tools/provision/provision.go:259-265 — 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) things/service.go:938— things/service.go:938-944 | uiconfigs/service.go:359-365 — 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) auth/tracing/invites.go:65— auth/tracing/invites.go:65-71 | filestore/tracing/groups.go:71-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `userID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) auth/tracing/memberships.go:48— auth/tracing/memberships.go:48-54 | things/tracing/memberships.go:86-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) mqtt/service.go:53— mqtt/service.go:53-59 | rules/service.go:410-416 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `token` in one and `thingID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) things/redis/groups.go:135— things/redis/groups.go:135-142 | things/redis/things.go:172-178 — 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.
AXI1 · Runtime container hardening· Container process runs as root · ×19
Container process runs as root: mainfluxlabs-alarms-db — 'mainfluxlabs-alarms-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-audit-db — 'mainfluxlabs-audit-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-auth-db — 'mainfluxlabs-auth-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-auth-redis — 'mainfluxlabs-auth-redis' (redis:6.2.2-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-broker — 'mainfluxlabs-broker' (nats:2.10-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-certs-db — 'mainfluxlabs-certs-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-downlinks-db — 'mainfluxlabs-downlinks-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-es-redis — 'mainfluxlabs-es-redis' (redis:6.2.2-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-filestore-db — 'mainfluxlabs-filestore-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-modbus-db — 'mainfluxlabs-modbus-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-mosquitto — 'mainfluxlabs-mosquitto' (eclipse-mosquitto:2.0) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-mqtt-adapter-db — 'mainfluxlabs-mqtt-adapter-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-nginx — 'mainfluxlabs-nginx' (nginx:1.20.0-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-rules-db — 'mainfluxlabs-rules-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-shadows-db — 'mainfluxlabs-shadows-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-smtp-notifier-db — 'mainfluxlabs-smtp-notifier-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-things-db — 'mainfluxlabs-things-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-timescale-db — 'mainfluxlabs-timescale-db' (timescale/timescaledb:2.15.3-pg16) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Container process runs as root: mainfluxlabs-uiconfigs-db — 'mainfluxlabs-uiconfigs-db' (postgres:13.3-alpine) runs as uid 0 — no user was specified, or one resolving to root was. Observed on the running container, which is the only place the answer is settled: an image's own USER, a base image's inherited one and a compose override are all invisible to a REDACTED reader. Advisory evidence for CRA Annex I (2)(b).
Duplicated block (12 lines × 2) auth/api/http/backup/endpoint.go:53— auth/api/http/backup/endpoint.go:53-64 | auth/api/http/orgs/endpoint.go:142-153 — 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) auth/api/http/backup/endpoint.go:55— auth/api/http/backup/endpoint.go:55-66 | auth/api/http/backup/endpoint.go:91-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/endpoint.go:55` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) auth/invites.go:401— auth/invites.go:401-412 | auth/invites.go:432-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/invites.go:401` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) cmd/auth/main.go:277— cmd/auth/main.go:277-288 | cmd/things/main.go:322-333 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:277` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) coap/adapter.go:172— coap/adapter.go:172-183 | ws/adapter.go:110-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `coap/adapter.go:172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) coap/api/logging.go:32— coap/api/logging.go:32-43 | ws/api/logging.go:33-44 — before extracting anything, compare `coap/api/logging.go` and `ws/api/logging.go` 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. 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 2) consumers/alarms/postgres/alarms.go:122— consumers/alarms/postgres/alarms.go:122-133 | consumers/alarms/postgres/alarms.go:153-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/postgres/alarms.go:122` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) consumers/writers/postgres/consumer.go:37— consumers/writers/postgres/consumer.go:37-48 | consumers/writers/timescale/consumer.go:37-48 — `consumers/writers/postgres/consumer.go` and `consumers/writers/timescale/consumer.go` 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 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) filestore/postgres/groups.go:237— filestore/postgres/groups.go:237-248 | filestore/postgres/things.go:235-249 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/postgres/groups.go:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) modbus/postgres/clients.go:145— modbus/postgres/clients.go:145-156 | modbus/postgres/clients.go:195-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modbus/postgres/clients.go:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) pkg/events/schema.go:117— pkg/events/schema.go:117-128 | pkg/events/schema.go:162-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/events/schema.go:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) readers/api/http/messages/requests.go:22— readers/api/http/messages/requests.go:22-33 | readers/api/http/messages/requests.go:58-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) readers/postgres/aggregations.go:400— readers/postgres/aggregations.go:400-412 | readers/timescale/aggregations.go:227-238 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/aggregations.go:400` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) readers/postgres/senml.go:140— readers/postgres/senml.go:140-151 | readers/timescale/senml.go:181-192 — `readers/postgres/senml.go` and `readers/timescale/senml.go` 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 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) rules/api/http/rules/endpoint.go:207— rules/api/http/rules/endpoint.go:207-218 | rules/api/http/scripts/endpoint.go:206-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `rules/api/http/rules/endpoint.go:207` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) things/api/http/backup/endpoint.go:84— things/api/http/backup/endpoint.go:84-95 | things/api/http/backup/endpoint.go:135-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `things/api/http/backup/endpoint.go:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) things/postgres/groups.go:251— things/postgres/groups.go:251-262 | things/postgres/groups.go:275-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. Read the line range as the matched WINDOW rather than a finished unit: at `things/postgres/groups.go:251` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) users/api/http/backup/transport.go:98— users/api/http/backup/transport.go:98-109 | users/api/http/invites/transport.go:178-189 — `users/api/http/backup/transport.go` and `users/api/http/invites/transport.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `users/api/http/backup/transport.go:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×17
Edited copy of a member (15 corresponding lines) things/postgres/groups.go:220— things/postgres/groups.go:220-234 | things/postgres/profiles.go:105-122 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) auth/api/http/orgs/transport.go:198— auth/api/http/orgs/transport.go:198-212 | things/api/http/groups/transport.go:303-317 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) auth/postgres/memberships.go:77— auth/postgres/memberships.go:77-96 | auth/postgres/memberships.go:98-112 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) http/api/endpoint.go:25— http/api/endpoint.go:25-39 | http/api/endpoint.go:41-55 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) auth/postgres/memberships.go:114— auth/postgres/memberships.go:114-128 | things/postgres/memberships.go:62-76 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) things/api/grpc/endpoint.go:14— things/api/grpc/endpoint.go:14-35 | things/api/grpc/endpoint.go:201-215 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) readers/service.go:115— readers/service.go:115-129 | readers/service.go:131-145 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) audit/api/http/endpoint.go:29— audit/api/http/endpoint.go:29-43 | consumers/alarms/api/http/endpoint.go:48-62 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) auth/api/grpc/endpoint.go:209— auth/api/grpc/endpoint.go:209-223 | auth/api/http/memberships/endpoint.go:27-48 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) users/api/http/users/endpoint.go:31— users/api/http/users/endpoint.go:31-45 | users/api/http/users/endpoint.go:47-64 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) shadows/api/http/endpoint.go:13— shadows/api/http/endpoint.go:13-27 | shadows/api/http/endpoint.go:29-43 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) things/api/grpc/endpoint.go:249— things/api/grpc/endpoint.go:249-263 | things/api/grpc/endpoint.go:281-295 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) rules/api/http/rules/endpoint.go:81— rules/api/http/rules/endpoint.go:81-96 | rules/api/http/rules/endpoint.go:98-112 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) readers/api/http/messages/transport.go:242— readers/api/http/messages/transport.go:242-256 | readers/api/http/messages/transport.go:258-272 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) auth/postgres/roles.go:63— auth/postgres/roles.go:63-77 | auth/postgres/roles.go:113-127 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) mqtt/postgres/subscriptions.go:23— mqtt/postgres/subscriptions.go:23-47 | things/postgres/memberships.go:157-171 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) things/api/http/things/requests.go:87— things/api/http/things/requests.go:87-105 | things/api/http/groups/requests.go:142-156 — 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.
Swallowed exception (caught, then discarded) REDACTED:133— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:148— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) things/service.go:1003— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) shadows/service.go:186— `if err := json.Unmarshal(record.Payload, &recordState); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) shadows/service.go:197— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) readers/api/grpc/client.go:157— `if err := json.Unmarshal(record.GetPayload(), &sm); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) readers/api/grpc/server.go:152— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/readers/query.go:204— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/protoutil/mapper.go:89— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/email/email.go:170— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/email/email.go:174— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/cron/validation.go:70— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/clients/http/http.go:97— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/authn/decode.go:23— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/authn/decode.go:29— `if err := json.Unmarshal(payload, &claims); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) mqtt/redis/cache/subscriptions.go:80— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (14 lines × 2) auth/memberships.go:84— auth/memberships.go:84-97 | auth/memberships.go:219-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/memberships.go:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `auth/memberships.go:99` calls `getTimestamp` and `auth/memberships.go:234` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) certs/postgres/certs.go:41— certs/postgres/certs.go:41-54 | certs/postgres/certs.go:227-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 2) cmd/converters/main.go:71— cmd/converters/main.go:71-84 | cmd/filestore/main.go:133-146 — `cmd/converters/main.go` and `cmd/filestore/main.go` 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 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 (14 lines × 2) cmd/converters/main.go:133— cmd/converters/main.go:133-146 | cmd/http/main.go:111-124 — `cmd/converters/main.go` and `cmd/http/main.go` 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 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/converters/main.go:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) cmd/converters/main.go:150— cmd/converters/main.go:150-163 | cmd/http/main.go:128-141 — `cmd/converters/main.go` and `cmd/http/main.go` 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 68 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) converters/service.go:71— converters/service.go:71-84 | converters/service.go:218-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) filestore/store/seaweedfs.go:187— filestore/store/seaweedfs.go:187-200 | filestore/store/seaweedfs.go:219-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 2) pkg/apiutil/transport.go:330— pkg/apiutil/transport.go:330-343 | pkg/apiutil/transport.go:350-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 (14 lines × 2) readers/api/http/messages/transport.go:413— readers/api/http/messages/transport.go:413-426 | readers/api/http/messages/transport.go:444-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) readers/postgres/senml.go:54— readers/postgres/senml.go:54-67 | readers/timescale/senml.go:60-73 — `readers/postgres/senml.go` and `readers/timescale/senml.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/senml.go:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) things/api/http/profiles/transport.go:215— things/api/http/profiles/transport.go:215-228 | things/api/http/things/transport.go:298-311 — `things/api/http/profiles/transport.go` and `things/api/http/things/transport.go` 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 178 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) webhooks/api/http/endpoint.go:142— webhooks/api/http/endpoint.go:142-155 | webhooks/api/http/endpoint.go:160-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webhooks/api/http/endpoint.go:142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) downlinks/service.go:319— downlinks/service.go:319-332 | modbus/service.go:566-579 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `downlinks/service.go:314` calls `Info`, `Sprintf` and `modbus/service.go:561` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) things/api/http/profiles/transport.go:294— things/api/http/profiles/transport.go:294-307 | things/api/http/things/transport.go:392-405 — `things/api/http/profiles/transport.go` and `things/api/http/things/transport.go` 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 178 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) things/api/http/profiles/transport.go:338— things/api/http/profiles/transport.go:338-351 | things/api/http/things/transport.go:451-464 — `things/api/http/profiles/transport.go` and `things/api/http/things/transport.go` 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 178 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) audit/postgres/events.go:89— audit/postgres/events.go:89-101 | audit/postgres/events.go:122-134 — both copies are in the same file, so extract the block into 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) auth/api/http/backup/endpoint.go:14— auth/api/http/backup/endpoint.go:14-26 | things/api/http/backup/endpoint.go:18-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/endpoint.go:14` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) REDACTED:268— REDACTED:268-280 | REDACTED:353-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) cmd/auth/main.go:217— cmd/auth/main.go:217-229 | cmd/rules/main.go:160-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:217` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) cmd/smpp-notifier/main.go:278— cmd/smpp-notifier/main.go:278-290 | cmd/smtp-notifier/main.go:274-286 — `cmd/smpp-notifier/main.go` and `cmd/smtp-notifier/main.go` 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 19 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/smpp-notifier/main.go:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) downlinks/postgres/downlinks.go:359— downlinks/postgres/downlinks.go:359-371 | downlinks/postgres/downlinks.go:395-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/postgres/downlinks.go:359` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) filestore/api/http/transport.go:230— filestore/api/http/transport.go:230-242 | filestore/api/http/transport.go:332-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/api/http/transport.go:230` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) filestore/postgres/groups.go:40— filestore/postgres/groups.go:40-52 | filestore/postgres/things.go:41-53 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/postgres/groups.go:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) modbus/api/http/endpoint.go:25— modbus/api/http/endpoint.go:25-37 | modbus/api/http/endpoint.go:58-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) modbus/postgres/clients.go:356— modbus/postgres/clients.go:356-368 | modbus/postgres/clients.go:387-399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `modbus/postgres/clients.go:356` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) things/api/http/memberships/endpoint.go:18— things/api/http/memberships/endpoint.go:18-30 | things/api/http/memberships/endpoint.go:59-71 — both copies are in the same file, so extract the block into 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) things/postgres/profiles.go:162— things/postgres/profiles.go:162-174 | things/postgres/profiles.go:254-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. Read the line range as the matched WINDOW rather than a finished unit: at `things/postgres/profiles.go:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) things/postgres/things.go:172— things/postgres/things.go:172-184 | things/postgres/things.go:220-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `things/postgres/things.go:172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) rules/api/http/rules/transport.go:248— rules/api/http/rules/transport.go:248-260 | rules/api/http/scripts/transport.go:191-203 — `rules/api/http/rules/transport.go` and `rules/api/http/scripts/transport.go` 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 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 (13 lines × 2) pkg/sdk/go/messages.go:201— pkg/sdk/go/messages.go:201-213 | pkg/sdk/go/messages.go:239-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×14
Edited copy of a member (8 corresponding lines) coap/api/metrics.go:44— coap/api/metrics.go:44-51 | ws/api/metrics.go:44-51 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) http/api/metrics.go:62— http/api/metrics.go:62-69 | ws/api/metrics.go:71-78 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) http/api/metrics.go:71— http/api/metrics.go:71-78 | ws/api/metrics.go:89-96 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) coap/api/metrics.go:71— coap/api/metrics.go:71-78 | ws/api/metrics.go:53-60 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) downlinks/api/metrics.go:108— downlinks/api/metrics.go:108-115 | modbus/api/metrics.go:132-139 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) auth/api/metrics.go:42— auth/api/metrics.go:42-49 | users/api/metrics.go:88-95 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) auth/api/metrics.go:114— auth/api/metrics.go:114-121 | things/api/metrics.go:267-274 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) consumers/alarms/api/metrics.go:110— consumers/alarms/api/metrics.go:110-117 | rules/api/metrics.go:138-145 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) things/api/metrics.go:142— things/api/metrics.go:142-149 | users/api/metrics.go:124-131 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) downlinks/api/metrics.go:117— downlinks/api/metrics.go:117-124 | modbus/api/metrics.go:141-148 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) coap/api/transport.go:219— coap/api/transport.go:219-226 | REDACTED:128-135 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) cmd/timescale-reader/main.go:235— cmd/timescale-reader/main.go:235-242 | cmd/timescale-writer/main.go:136-143 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) things/groups.go:204— things/groups.go:204-211 | things/service.go:410-417 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) shadows/api/http/transport.go:88— shadows/api/http/transport.go:88-95 | uiconfigs/api/http/things/transport.go:67-74 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×14
Edited copy of a member (7 corresponding lines) filestore/tracing/groups.go:39— filestore/tracing/groups.go:39-45 | filestore/tracing/things.go:42-48 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) filestore/tracing/groups.go:47— filestore/tracing/groups.go:47-53 | filestore/tracing/things.go:50-56 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) filestore/tracing/groups.go:55— filestore/tracing/groups.go:55-61 | filestore/tracing/things.go:58-64 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) things/tracing/cache.go:74— things/tracing/cache.go:74-80 | things/tracing/profiles.go:125-131 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) auth/tracing/memberships.go:56— auth/tracing/memberships.go:56-62 | things/tracing/memberships.go:78-84 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) readers/tracing/json.go:52— readers/tracing/json.go:52-58 | readers/tracing/senml.go:52-58 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) readers/tracing/json.go:44— readers/tracing/json.go:44-50 | readers/tracing/senml.go:44-50 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) things/tracing/cache.go:82— things/tracing/cache.go:82-88 | things/tracing/profiles.go:133-139 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) things/tracing/cache.go:90— things/tracing/cache.go:90-96 | things/tracing/profiles.go:141-147 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) things/tracing/groups.go:179— things/tracing/groups.go:179-185 | things/tracing/memberships.go:62-68 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) auth/api/grpc/server.go:179— auth/api/grpc/server.go:179-185 | things/api/grpc/server.go:224-231 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) things/tracing/cache.go:58— things/tracing/cache.go:58-64 | things/tracing/things.go:110-116 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) downlinks/tracing/downlinks.go:72— downlinks/tracing/downlinks.go:72-78 | modbus/tracing/clients.go:70-76 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) filestore/postgres/queries.go:8— filestore/postgres/queries.go:8-14 | pkg/dbutil/query.go:17-26 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (8 lines × 2) auth/postgres/memberships.go:141— auth/postgres/memberships.go:141-148 | auth/postgres/memberships.go:180-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/memberships.go:141` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) auth/postgres/orgs.go:80— auth/postgres/orgs.go:80-87 | things/postgres/things.go:301-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `auth/postgres/orgs.go:89` calls `Wrap` and `things/postgres/things.go:309` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) auth/postgres/roles.go:32— auth/postgres/roles.go:32-40 | users/postgres/identity.go:37-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/roles.go:32` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) cmd/smpp-notifier/main.go:330— cmd/smpp-notifier/main.go:330-337 | cmd/smtp-notifier/main.go:333-340 — `cmd/smpp-notifier/main.go` and `cmd/smtp-notifier/main.go` 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 19 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/smpp-notifier/main.go:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) consumers/alarms/postgres/alarms.go:106— consumers/alarms/postgres/alarms.go:106-113 | consumers/alarms/postgres/alarms.go:137-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/postgres/alarms.go:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) consumers/alarms/service.go:155— consumers/alarms/service.go:155-162 | rules/service.go:435-442 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/service.go:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) consumers/writers/api/logging.go:33— consumers/writers/api/logging.go:33-40 | rules/api/logging.go:180-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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) pkg/events/schema.go:138— pkg/events/schema.go:138-145 | pkg/events/schema.go:178-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/events/schema.go:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) rules/service.go:302— rules/service.go:302-309 | rules/service.go:316-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) auth/postgres/memberships.go:81— auth/postgres/memberships.go:81-88 | auth/postgres/memberships.go:102-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) cmd/postgres-reader/main.go:261— cmd/postgres-reader/main.go:261-268 | cmd/postgres-writer/main.go:138-145 — `cmd/postgres-reader/main.go` and `cmd/postgres-writer/main.go` 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 41 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) things/api/http/groups/transport.go:174— things/api/http/groups/transport.go:174-181 | things/api/http/profiles/transport.go:205-212 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) auth/api/grpc/client.go:652— auth/api/grpc/client.go:652-659 | things/api/grpc/client.go:553-560 — 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) cmd/uiconfigs/main.go:271— cmd/uiconfigs/main.go:271-278 | cmd/users/main.go:397-404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/uiconfigs/main.go:271` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×13
Edited copy of a member (14 corresponding lines) auth/postgres/key.go:46— auth/postgres/key.go:46-59 | auth/postgres/orgs.go:141-155 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) readers/postgres/init.go:28— readers/postgres/init.go:28-41 | readers/timescale/init.go:28-41 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) auth/api/http/memberships/endpoint.go:12— auth/api/http/memberships/endpoint.go:12-25 | auth/api/http/memberships/endpoint.go:75-88 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) certs/api/endpoint.go:13— certs/api/endpoint.go:13-26 | certs/api/endpoint.go:28-42 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) auth/api/http/memberships/endpoint.go:90— auth/api/http/memberships/endpoint.go:90-103 | things/api/http/memberships/endpoint.go:81-94 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) modbus/api/http/transport.go:163— modbus/api/http/transport.go:163-176 | modbus/api/http/transport.go:179-192 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) auth/api/http/orgs/endpoint.go:83— auth/api/http/orgs/endpoint.go:83-96 | auth/api/http/orgs/endpoint.go:98-111 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) auth/api/http/sessions/endpoint.go:15— auth/api/http/sessions/endpoint.go:15-28 | auth/api/http/sessions/endpoint.go:30-43 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) users/api/http/users/transport.go:579— users/api/http/users/transport.go:579-595 | users/api/http/users/transport.go:597-610 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) certs/postgres/certs.go:310— certs/postgres/certs.go:310-323 | certs/postgres/certs.go:325-338 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) users/postgres/users.go:70— users/postgres/users.go:70-83 | users/postgres/users.go:85-103 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) rules/postgres/rules.go:285— rules/postgres/rules.go:285-298 | rules/postgres/rules.go:368-385 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) auth/api/http/invites/transport.go:143— auth/api/http/invites/transport.go:143-157 | users/api/http/invites/transport.go:122-135 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×11
Edited copy of a member (12 corresponding lines) users/api/http/users/endpoint.go:266— users/api/http/users/endpoint.go:266-277 | users/api/http/users/endpoint.go:279-290 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) users/api/http/users/endpoint.go:292— users/api/http/users/endpoint.go:292-303 | users/api/http/users/endpoint.go:305-316 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) readers/api/grpc/server.go:96— readers/api/grpc/server.go:96-107 | readers/api/grpc/server.go:109-123 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) REDACTED:102— REDACTED:102-113 | REDACTED:115-126 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) auth/api/validation.go:12— auth/api/validation.go:12-23 | things/api/validation.go:12-23 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) things/redis/groups.go:98— things/redis/groups.go:98-109 | things/redis/groups.go:144-155 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) certs/api/transport.go:205— certs/api/transport.go:205-216 | certs/api/transport.go:218-233 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) things/service.go:1140— things/service.go:1140-1155 | things/service.go:1157-1168 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) uiconfigs/service.go:104— uiconfigs/service.go:104-115 | uiconfigs/service.go:144-155 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) rules/api/http/scripts/transport.go:239— rules/api/http/scripts/transport.go:239-250 | things/api/http/memberships/transport.go:186-199 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) modbus/service.go:166— modbus/service.go:166-177 | downlinks/service.go:119-130 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (15 lines × 2) auth/postgres/invites.go:303— auth/postgres/invites.go:303-317 | auth/postgres/invites.go:380-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:303` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `orgID` in one and `userID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) cmd/downlinks/main.go:156— cmd/downlinks/main.go:156-170 | cmd/modbus/main.go:154-168 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) filestore/api/http/transport.go:190— filestore/api/http/transport.go:190-204 | filestore/api/http/transport.go:290-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. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/api/http/transport.go:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) readers/timescale/aggregations.go:72— readers/timescale/aggregations.go:72-86 | readers/timescale/aggregations.go:121-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `readers/timescale/aggregations.go:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `readers/timescale/aggregations.go:121` is reached only past a guard at line 107 that tests `rpm.AggType` and leaves the function early, and `readers/timescale/aggregations.go:72` reads `rpm.AggType` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (15 lines × 2) readers/timescale/json.go:97— readers/timescale/json.go:97-111 | readers/timescale/senml.go:99-113 — before extracting anything, compare `readers/timescale/json.go` and `readers/timescale/senml.go` as WHOLE FILES: this scan already matched 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/timescale/json.go:97` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) things/api/http/backup/endpoint.go:33— things/api/http/backup/endpoint.go:33-47 | uiconfigs/api/http/backup/endpoint.go:38-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) webhooks/postgres/webhooks.go:75— webhooks/postgres/webhooks.go:75-89 | webhooks/postgres/webhooks.go:107-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `webhooks/postgres/webhooks.go:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `groupID` in one and `thingID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) filestore/postgres/groups.go:115— filestore/postgres/groups.go:115-129 | filestore/postgres/things.go:116-130 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) auth/api/http/memberships/requests.go:93— auth/api/http/memberships/requests.go:93-107 | shadows/api/http/requests.go:17-31 — 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) consumers/alarms/api/http/requests.go:115— consumers/alarms/api/http/requests.go:115-129 | rules/api/http/rules/requests.go:197-211 — 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) filestore/api/http/requests.go:152— filestore/api/http/requests.go:152-166 | mqtt/api/http/request.go:19-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) auth/api/metrics.go:44— auth/api/metrics.go:44-49 | users/api/metrics.go:90-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/metrics.go:44` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) auth/api/metrics.go:116— auth/api/metrics.go:116-121 | things/api/metrics.go:269-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/metrics.go:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) auth/postgres/orgs.go:158— auth/postgres/orgs.go:158-163 | auth/postgres/orgs.go:204-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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) consumers/alarms/api/metrics.go:112— consumers/alarms/api/metrics.go:112-117 | rules/api/metrics.go:140-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/api/metrics.go:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) downlinks/api/metrics.go:110— downlinks/api/metrics.go:110-115 | modbus/api/metrics.go:134-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/api/metrics.go:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) downlinks/api/metrics.go:119— downlinks/api/metrics.go:119-124 | modbus/api/metrics.go:143-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/api/metrics.go:119` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) downlinks/postgres/downlinks.go:49— downlinks/postgres/downlinks.go:49-54 | webhooks/postgres/webhooks.go:45-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/postgres/downlinks.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) readers/api/grpc/client.go:84— readers/api/grpc/client.go:84-89 | readers/api/grpc/client.go:106-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) things/postgres/things.go:164— things/postgres/things.go:164-169 | things/postgres/things.go:212-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `things/postgres/things.go:163` calls `GetGroupIDsQuery` and `things/postgres/things.go:211` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) downlinks/service.go:133— downlinks/service.go:133-138 | modbus/service.go:180-185 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/service.go:133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) auth/postgres/sessions.go:120— auth/postgres/sessions.go:120-126 | mqtt/postgres/subscriptions.go:111-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.
TooManyMethods: mfSDK REDACTED:481— TooManyMethods — 91 methods, declared across 14 files: go/messages.go (13), go/groups.go (12), go/things.go (11), go/profiles.go (8), +10 more file(s). The bar is 30 methods; this is 61 over it, 3.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement go.SDK (85 of 91 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: thingsService things/service.go:205— TooManyMethods — 70 methods, declared across 3 files: things/service.go (50), things/groups.go (14), REDACTED (6). The bar is 30 methods; this is 40 over it, 2.33× 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: service auth/service.go:105— TooManyMethods — 59 methods, declared across 6 files: auth/keys.go (15), auth/invites.go (13), auth/service.go (11), auth/memberships.go (9), +2 more file(s). The bar is 30 methods; this is 29 over it, 1.97× 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: loggingMiddleware things/api/logging.go:21— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. Most of these members implement things.Service (39 of 57 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: metricsMiddleware things/api/metrics.go:19— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. Most of these members implement things.Service (39 of 57 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: usersService users/service.go:179— TooManyMethods — 45 methods, declared across 2 files: users/service.go (38), users/invites.go (7). The bar is 30 methods; this is 15 over it, 1.50× 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: loggingMiddleware auth/api/logging.go:20— 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: metricsMiddleware auth/api/metrics.go:18— 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: loggingMiddleware users/api/logging.go:21— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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: metricsMiddleware users/api/metrics.go:19— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× 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.
X3 · Exception handling· Discarded error (an error-returning call as a bare statement) · ×10
Discarded error (an error-returning call as a bare statement) REDACTED:95— `svc.Publish(context.Background(), req.ThingKey, buildMessage(req.subtopic, payload))` returns an error, and the statement drops it: when `svc.Publish` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.Publish(context.Background(), req.ThingKey, buildMessage(req.subtopic, payload)); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) REDACTED:107— `svc.SendCommandToThing(context.Background(), req.token, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToThing` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToThing(context.Background(), req.token, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) REDACTED:109— `svc.SendCommandToThingByKey(context.Background(), req.thingKey, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToThingByKey` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToThingByKey(context.Background(), req.thingKey, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) REDACTED:120— `svc.SendCommandToGroup(context.Background(), req.token, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToGroup` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToGroup(context.Background(), req.token, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) REDACTED:122— `svc.SendCommandToGroupByKey(context.Background(), req.thingKey, req.id, c)` returns an error, and the statement drops it: when `svc.SendCommandToGroupByKey` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendCommandToGroupByKey(context.Background(), req.thingKey, req.id, c); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) users/invites.go:121— `svc.SendPlatformInviteEmail(ctx, invite, redirectPath)` returns an error, and the statement drops it: when `svc.SendPlatformInviteEmail` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendPlatformInviteEmail(ctx, invite, redirectPath); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) users/service.go:294— `svc.emailVerifications.Remove(ctx, token)` returns an error, and the statement drops it: when `svc.emailVerifications.Remove` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.emailVerifications.Remove(ctx, token); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) users/service.go:904— `svc.SendPasswordReset(ctx, redirectPath, email, t)` returns an error, and the statement drops it: when `svc.SendPasswordReset` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := svc.SendPasswordReset(ctx, redirectPath, email, t); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) users/postgres/invites.go:33— `errors.Wrap(dbutil.ErrCreateEntity, err)` returns an error, and the statement drops it: when `errors.Wrap` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := errors.Wrap(dbutil.ErrCreateEntity, err); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
Discarded error (an error-returning call as a bare statement) REDACTED:162— `ts.email.SendGroupMembershipNotification([]string{recipientEmail}, org.Name, group.Name, gm.Role, redirectPath)` returns an error, and the statement drops it: when `ts.email.SendGroupMembershipNotification` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ts.email.SendGroupMembershipNotification([]string{recipientEmail}, org.Name, group.Name, gm.Role, redirectPath); err != nil { … }`) and return or log it with what was being done, or assign it to `_` with a comment saying why the failure cannot matter.
X3 · Exception handling· Discarded error (assigned to `_`, then its result used) · ×10
Discarded error (assigned to `_`, then its result used) things/api/http/groups/transport.go:198— `n, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `n` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `n` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `n` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) things/api/http/groups/transport.go:199— `m, _ := apiutil.ReadMetadataQuery(r, apiutil.MetadataKey, nil)` writes the call's error to `_` and then uses `m` as if the call succeeded. When `apiutil.ReadMetadataQuery` fails, `m` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `m` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) rules/api/http/scripts/transport.go:132— `name, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `name` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `name` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `name` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) rules/api/http/rules/transport.go:151— `name, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `name` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `name` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `name` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) rules/api/http/rules/transport.go:152— `inputType, _ := apiutil.ReadStringQuery(r, apiutil.InputTypeKey, "")` writes the call's error to `_` and then uses `inputType` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `inputType` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `inputType` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) rules/api/http/rules/transport.go:175— `name, _ := apiutil.ReadStringQuery(r, apiutil.NameKey, "")` writes the call's error to `_` and then uses `name` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `name` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `name` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) rules/api/http/rules/transport.go:176— `inputType, _ := apiutil.ReadStringQuery(r, apiutil.InputTypeKey, "")` writes the call's error to `_` and then uses `inputType` as if the call succeeded. When `apiutil.ReadStringQuery` fails, `inputType` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `inputType` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) readers/timescale/aggregations.go:414— `escaped, _ := escapeFieldName(parts[0])` writes the call's error to `_` and then uses `escaped` as if the call succeeded. When `escapeFieldName` fails, `escaped` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `escaped` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) readers/timescale/aggregations.go:421— `escaped, _ := escapeFieldName(part)` writes the call's error to `_` and then uses `escaped` as if the call succeeded. When `escapeFieldName` fails, `escaped` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `escaped` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
Discarded error (assigned to `_`, then its result used) pkg/readers/query.go:151— `quotedName, _ := json.Marshal(name)` writes the call's error to `_` and then uses `quotedName` as if the call succeeded. When `json.Marshal` fails, `quotedName` is its zero value (nil for a pointer, a map or an interface), so the program panics later or goes on with a default it never chose, and nothing records why. Check the error before using `quotedName` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×9
Edited copy of a member (17 corresponding lines) converters/api/endpoint.go:13— converters/api/endpoint.go:13-29 | converters/api/endpoint.go:31-47 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) pkg/sdk/go/groups.go:174— pkg/sdk/go/groups.go:174-190 | pkg/sdk/go/orgs.go:121-138 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) users/api/http/backup/transport.go:93— users/api/http/backup/transport.go:93-109 | users/api/http/invites/transport.go:173-189 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) consumers/alarms/service.go:151— consumers/alarms/service.go:151-167 | rules/service.go:431-447 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) readers/postgres/json.go:143— readers/postgres/json.go:143-159 | readers/timescale/json.go:57-73 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) auth/api/grpc/client.go:535— auth/api/grpc/client.go:535-553 | auth/api/grpc/server.go:470-486 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) auth/api/http/invites/endpoint.go:86— auth/api/http/invites/endpoint.go:86-102 | auth/api/http/invites/endpoint.go:104-120 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) http/api/requests.go:36— http/api/requests.go:36-52 | http/api/requests.go:58-74 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) pkg/messaging/mqtt/pubsub.go:50— pkg/messaging/mqtt/pubsub.go:50-66 | pkg/messaging/nats/pubsub.go:72-89 — 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.
DM10 · One transaction, one aggregate· One operation mutates 2 aggregates · ×9
One operation mutates 2 aggregates: service.CreateOrg auth/orgs.go:88— `service.CreateOrg` saves `OrgRepository`, `OrgMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: service.Restore auth/service.go:268— `service.Restore` saves `OrgRepository`, `OrgMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: filestoreService.RemoveFile filestore/service.go:240— `filestoreService.RemoveFile` saves `FileStore`, `ThingsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: filestoreService.RemoveGroupFile filestore/service.go:334— `filestoreService.RemoveGroupFile` saves `FileStore`, `GroupsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: thingsService.CreateGroups things/groups.go:121— `thingsService.CreateGroups` saves `GroupRepository`, `GroupMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: usersService.SelfRegister users/service.go:233— `usersService.SelfRegister` saves `UserRepository`, `EmailVerificationRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: usersService.VerifyEmail users/service.go:348— `usersService.VerifyEmail` saves `EmailVerificationRepository`, `UserRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: usersService.handleIdentity users/service.go:646— `usersService.handleIdentity` saves `UserRepository`, `IdentityRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
One operation mutates 2 aggregates: usersService.Restore users/service.go:852— `usersService.Restore` saves `UserRepository`, `IdentityRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
AXH1 · Runtime security headers· Runtime security header not set · ×8
Runtime security header not set: content-security-policy — The live app's responses did not include content-security-policy (restricts the sources a page may load — mitigates XSS/injection). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: cross-origin-embedder-policy — The live app's responses did not include cross-origin-embedder-policy (recommended by the OWASP Secure Headers Project (value: require-corp)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: cross-origin-opener-policy — The live app's responses did not include cross-origin-opener-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: cross-origin-resource-policy — The live app's responses did not include cross-origin-resource-policy (recommended by the OWASP Secure Headers Project (value: same-origin)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: permissions-policy — The live app's responses did not include permissions-policy (restricts powerful browser features (camera, geolocation, …)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: referrer-policy — The live app's responses did not include referrer-policy (limits referrer leakage to third parties). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: x-dns-prefetch-control — The live app's responses did not include x-dns-prefetch-control (recommended by the OWASP Secure Headers Project (value: off)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
Runtime security header not set: x-permitted-cross-domain-policies — The live app's responses did not include x-permitted-cross-domain-policies (recommended by the OWASP Secure Headers Project (value: none)). Observed by booting the app in-sandbox — advisory evidence for AppSec / CRA / NIS2 runtime secure-defaults. Set it at your reverse proxy or in the app.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (4 members, 50+ identical tokens) auth/api/http/invites/transport.go:107— auth/api/http/invites/transport.go:107-122 | auth/api/http/memberships/transport.go:133-154 | auth/api/http/memberships/transport.go:166-177 | uiconfigs/api/http/orgs/transport.go:91-105 — 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) cmd/auth/main.go:231— cmd/auth/main.go:231-350 | cmd/smtp-notifier/main.go:208-290 | cmd/things/main.go:248-359 | cmd/users/main.go:222-341 — 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) consumers/writers/postgres/consumer.go:50— consumers/writers/postgres/consumer.go:50-90 | consumers/writers/postgres/consumer.go:97-135 | consumers/writers/timescale/consumer.go:50-90 | consumers/writers/timescale/consumer.go:97-135 — 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) pkg/sdk/go/messages.go:119— pkg/sdk/go/messages.go:119-137 | pkg/sdk/go/messages.go:139-157 | pkg/sdk/go/messages.go:159-177 | pkg/sdk/go/messages.go:179-197 — 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) readers/postgres/aggregations.go:78— readers/postgres/aggregations.go:78-109 | readers/postgres/senml.go:51-72 | readers/timescale/aggregations.go:88-135 | readers/timescale/senml.go:57-78 — 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) readers/postgres/aggregations.go:384— readers/postgres/aggregations.go:384-412 | readers/postgres/json.go:101-118 | readers/timescale/aggregations.go:211-238 | readers/timescale/json.go:178-195 — 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) readers/postgres/json.go:36— readers/postgres/json.go:36-77 | readers/postgres/senml.go:74-115 | readers/timescale/json.go:113-154 | readers/timescale/senml.go:115-156 — 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) readers/postgres/json.go:79— readers/postgres/json.go:79-99 | readers/postgres/senml.go:117-137 | readers/timescale/json.go:156-176 | readers/timescale/senml.go:158-178 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×8
Edited copy of a member (21 corresponding lines) readers/api/grpc/server.go:175— readers/api/grpc/server.go:175-195 | things/api/grpc/server.go:478-506 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) mqtt/handler.go:328— mqtt/handler.go:328-348 | mqtt/handler.go:351-371 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) readers/api/grpc/client.go:81— readers/api/grpc/client.go:81-101 | readers/api/grpc/client.go:103-126 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) readers/service.go:71— readers/service.go:71-91 | readers/service.go:93-113 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rules/api/http/rules/endpoint.go:114— rules/api/http/rules/endpoint.go:114-137 | rules/api/http/scripts/endpoint.go:76-96 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) readers/api/grpc/client.go:128— readers/api/grpc/client.go:128-148 | readers/api/grpc/client.go:150-172 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) cmd/postgres-writer/main.go:147— cmd/postgres-writer/main.go:147-167 | cmd/timescale-writer/main.go:145-165 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) auth/api/http/memberships/requests.go:65— auth/api/http/memberships/requests.go:65-85 | things/api/http/groups/requests.go:30-50 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×8
Edited copy of a member (19 corresponding lines) downlinks/service.go:204— downlinks/service.go:204-222 | modbus/service.go:447-470 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) users/api/http/users/endpoint.go:104— users/api/http/users/endpoint.go:104-122 | users/api/http/users/endpoint.go:124-143 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) auth/api/http/invites/transport.go:184— auth/api/http/invites/transport.go:184-202 | users/api/http/invites/transport.go:137-155 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) cmd/mqtt/main.go:371— cmd/mqtt/main.go:371-389 | cmd/mqtt/main.go:391-409 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) consumers/alarms/api/http/transport.go:296— consumers/alarms/api/http/transport.go:296-314 | readers/api/http/messages/transport.go:492-510 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) rules/api/http/rules/requests.go:61— rules/api/http/rules/requests.go:61-79 | rules/api/http/rules/requests.go:150-172 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) certs/api/requests.go:24— certs/api/requests.go:24-42 | certs/api/requests.go:53-75 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) consumers/notifiers/api/http/requests.go:118— consumers/notifiers/api/http/requests.go:118-136 | things/api/http/profiles/requests.go:74-94 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×7
Edited copy of a member (30 corresponding lines) downlinks/postgres/downlinks.go:373— downlinks/postgres/downlinks.go:373-407 | modbus/postgres/clients.go:370-399 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) modbus/postgres/clients.go:339— modbus/postgres/clients.go:339-368 | rules/postgres/rules.go:399-430 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) downlinks/api/http/backup/transport.go:27— downlinks/api/http/backup/transport.go:27-56 | uiconfigs/api/http/backup/transport.go:28-57 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) auth/postgres/invites.go:200— auth/postgres/invites.go:200-232 | users/postgres/verifications.go:83-112 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) auth/postgres/invites.go:532— auth/postgres/invites.go:532-561 | things/postgres/things.go:288-325 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) users/service.go:1133— users/service.go:1133-1162 | users/service.go:1164-1193 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) auth/invites.go:272— auth/invites.go:272-301 | auth/invites.go:359-393 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×7
Edited copies of one member (3 members, 11+ corresponding lines) auth/api/http/transport.go:23— auth/api/http/transport.go:23-35 | things/api/http/transport.go:25-36 | uiconfigs/api/http/transport.go:24-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) pkg/messaging/nats/pubsub.go:91— pkg/messaging/nats/pubsub.go:91-105 | pkg/messaging/nats/pubsub.go:133-147 | pkg/messaging/nats/pubsub.go:149-159 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) pkg/events/schema.go:134— pkg/events/schema.go:134-145 | pkg/events/schema.go:175-185 | pkg/events/schema.go:264-274 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) downlinks/events/handler.go:22— downlinks/events/handler.go:22-32 | modbus/events/handler.go:22-32 | uiconfigs/events/handler.go:22-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) uiconfigs/postgres/groups.go:225— uiconfigs/postgres/groups.go:225-235 | uiconfigs/postgres/orgs.go:225-235 | uiconfigs/postgres/things.go:241-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) things/api/http/groups/requests.go:122— things/api/http/groups/requests.go:122-132 | things/api/http/profiles/requests.go:176-186 | things/api/http/things/requests.go:242-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) modbus/api/http/requests.go:449— modbus/api/http/requests.go:449-459 | rules/api/http/rules/requests.go:104-114 | rules/api/http/scripts/requests.go:156-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (9 lines × 3) audit/postgres/events.go:66— audit/postgres/events.go:66-74 | audit/postgres/events.go:98-106 | audit/postgres/events.go:131-139 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `audit/postgres/events.go:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `orgID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 3) auth/postgres/invites.go:206— auth/postgres/invites.go:206-214 | filestore/postgres/groups.go:63-71 | filestore/postgres/things.go:64-72 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) cmd/downlinks/main.go:156— cmd/downlinks/main.go:156-164 | cmd/modbus/main.go:154-162 | cmd/shadows/main.go:157-165 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) coap/api/logging.go:38— coap/api/logging.go:38-46 | http/api/logging.go:35-43 | ws/api/logging.go:39-47 — before extracting anything, compare `coap/api/logging.go` and `http/api/logging.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `coap/api/logging.go:38` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) coap/api/logging.go:64— coap/api/logging.go:64-72 | http/api/logging.go:49-57 | ws/api/logging.go:79-87 — before extracting anything, compare `coap/api/logging.go` and `http/api/logging.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `coap/api/logging.go:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) coap/api/logging.go:77— coap/api/logging.go:77-85 | http/api/logging.go:63-71 | ws/api/logging.go:106-114 — before extracting anything, compare `coap/api/logging.go` and `http/api/logging.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `coap/api/logging.go:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) shadows/api/http/transport.go:78— shadows/api/http/transport.go:78-86 | things/api/http/things/transport.go:532-540 | uiconfigs/api/http/things/transport.go:96-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `shadows/api/http/transport.go:78` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
FunctionTooLong: main.main cmd/cli/main.go:18— FunctionTooLong — main runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: grpc.NewClient auth/api/grpc/client.go:51— FunctionTooLong — NewClient runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.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: things.MakeHandler things/api/http/things/transport.go:32— FunctionTooLong — MakeHandler runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.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.
FunctionTooLong: grpc.NewClient things/api/grpc/client.go:46— FunctionTooLong — NewClient runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: users.MakeHandler users/api/http/users/transport.go:38— FunctionTooLong — MakeHandler runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× 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: profiles.MakeHandler things/api/http/profiles/transport.go:28— FunctionTooLong — MakeHandler runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×6
Edited copy of a member (37 corresponding lines) downlinks/postgres/downlinks.go:163— downlinks/postgres/downlinks.go:163-199 | modbus/postgres/clients.go:226-265 — These two members are one piece of code written twice and then edited apart: 37 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 (37 corresponding lines) pkg/sdk/go/messages.go:199— pkg/sdk/go/messages.go:199-235 | pkg/sdk/go/messages.go:237-273 — These two members are one piece of code written twice and then edited apart: 37 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 (37 corresponding lines) downlinks/api/http/transport.go:123— downlinks/api/http/transport.go:123-159 | modbus/api/http/transport.go:234-276 — These two members are one piece of code written twice and then edited apart: 37 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 (37 corresponding lines) http/api/transport.go:128— http/api/transport.go:128-164 | http/api/transport.go:166-202 — These two members are one piece of code written twice and then edited apart: 37 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 (37 corresponding lines) auth/memberships.go:82— auth/memberships.go:82-118 | auth/memberships.go:212-255 — These two members are one piece of code written twice and then edited apart: 37 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 (37 corresponding lines) downlinks/api/http/backup/requests.go:38— downlinks/api/http/backup/requests.go:38-74 | downlinks/api/http/backup/responses.go:32-68 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×6
Edited copy of a member (25 corresponding lines) rules/postgres/scripts.go:54— rules/postgres/scripts.go:54-78 | users/postgres/invites.go:71-101 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) filestore/postgres/groups.go:224— filestore/postgres/groups.go:224-248 | filestore/postgres/things.go:222-249 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) uiconfigs/service.go:333— uiconfigs/service.go:333-357 | users/service.go:852-879 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) things/api/http/memberships/requests.go:43— things/api/http/memberships/requests.go:43-71 | things/api/http/memberships/requests.go:79-103 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) pkg/sdk/go/group_memberships.go:13— pkg/sdk/go/group_memberships.go:13-37 | pkg/sdk/go/invites.go:82-107 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) readers/api/http/messages/requests.go:316— readers/api/http/messages/requests.go:316-343 | readers/timescale/aggregations.go:255-279 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×6
Edited copy of a member (24 corresponding lines) readers/api/http/messages/endpoint.go:18— readers/api/http/messages/endpoint.go:18-41 | readers/api/http/messages/endpoint.go:43-66 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) things/api/http/profiles/endpoint.go:59— things/api/http/profiles/endpoint.go:59-82 | things/api/http/profiles/endpoint.go:84-107 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) pkg/sdk/go/certs.go:110— pkg/sdk/go/certs.go:110-134 | pkg/sdk/go/certs.go:197-220 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) auth/api/http/memberships/endpoint.go:105— auth/api/http/memberships/endpoint.go:105-131 | things/api/http/memberships/endpoint.go:96-119 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) rules/api/http/rules/responses.go:14— rules/api/http/rules/responses.go:14-40 | rules/api/http/scripts/responses.go:13-36 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) modbus/api/http/responses.go:10— modbus/api/http/responses.go:10-37 | webhooks/api/http/responses.go:12-35 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) auth/postgres/invites.go:275— auth/postgres/invites.go:275-291 | users/postgres/invites.go:172-188 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) cmd/postgres-writer/main.go:73— cmd/postgres-writer/main.go:73-89 | cmd/timescale-writer/main.go:72-88 — `cmd/postgres-writer/main.go` and `cmd/timescale-writer/main.go` 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 97 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/postgres-writer/main.go:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) cmd/postgres-writer/main.go:120— cmd/postgres-writer/main.go:120-136 | cmd/timescale-writer/main.go:118-134 — `cmd/postgres-writer/main.go` and `cmd/timescale-writer/main.go` 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 97 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/postgres-writer/main.go:120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) readers/api/http/messages/transport.go:182— readers/api/http/messages/transport.go:182-198 | readers/api/http/messages/transport.go:217-233 — both copies are in the same file, so extract the block into 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) readers/postgres/json.go:102— readers/postgres/json.go:102-118 | readers/timescale/json.go:179-195 — `readers/postgres/json.go` and `readers/timescale/json.go` 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 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) readers/postgres/senml.go:169— readers/postgres/senml.go:169-185 | readers/timescale/senml.go:81-97 — `readers/postgres/senml.go` and `readers/timescale/senml.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/senml.go:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) auth/postgres/invites.go:173— auth/postgres/invites.go:173-177 | auth/postgres/invites.go:245-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) consumers/alarms/postgres/alarms.go:116— consumers/alarms/postgres/alarms.go:116-120 | consumers/alarms/postgres/alarms.go:147-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/postgres/alarms.go:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `thingID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) consumers/notifiers/api/http/transport.go:119— consumers/notifiers/api/http/transport.go:119-123 | webhooks/api/http/transport.go:133-137 — before extracting anything, compare `consumers/notifiers/api/http/transport.go` and `webhooks/api/http/transport.go` as WHOLE FILES: this scan already matched 7 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 (5 lines × 2) downlinks/api/http/transport.go:191— downlinks/api/http/transport.go:191-195 | modbus/api/http/transport.go:308-312 — before extracting anything, compare `downlinks/api/http/transport.go` and `modbus/api/http/transport.go` as WHOLE FILES: this scan already matched 6 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 (5 lines × 2) auth/postgres/orgs.go:143— auth/postgres/orgs.go:143-147 | things/postgres/groups.go:222-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:143` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) users/api/logging.go:372— users/api/logging.go:372-376 | users/api/logging.go:382-386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
FileTooLong: users/service.go users/service.go— FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: usersService (39 blocks, 179-1293). The bar is 500 significant lines; this is 235 over it, 1.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: things/service.go things/service.go— FileTooLong — 649 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: thingsService (51 blocks, 205-1172). The bar is 500 significant lines; this is 149 over it, 1.30× 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: api/logging.go things/api/logging.go— FileTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: loggingMiddleware (58 blocks, 21-809). The bar is 500 significant lines; this is 67 over it, 1.13× 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: grpc/client.go auth/api/grpc/client.go— FileTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 31 over it, 1.06× 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: http/transport.go filestore/api/http/transport.go— FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 5 over it, 1.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (6 members, 50+ identical tokens) auth/api/http/orgs/transport.go:123— auth/api/http/orgs/transport.go:123-155 | consumers/notifiers/api/http/transport.go:157-189 | things/api/http/groups/transport.go:211-243 | things/api/http/profiles/transport.go:246-278 | things/api/http/things/transport.go:329-361 | webhooks/api/http/transport.go:171-203 — 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) auth/api/metrics.go:263— auth/api/metrics.go:263-270 | downlinks/api/metrics.go:126-133 | readers/api/metrics.go:52-59 | things/api/metrics.go:321-328 | uiconfigs/api/metrics.go:180-187 | users/api/metrics.go:250-257 — 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) auth/api/metrics.go:272— auth/api/metrics.go:272-279 | downlinks/api/metrics.go:135-142 | readers/api/metrics.go:61-68 | things/api/metrics.go:330-337 | uiconfigs/api/metrics.go:189-196 | users/api/metrics.go:259-266 — 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) auth/postgres/invites.go:269— auth/postgres/invites.go:269-292 | auth/postgres/invites.go:447-480 | auth/postgres/invites.go:509-530 | users/postgres/invites.go:166-189 | users/postgres/invites.go:193-213 | users/postgres/invites.go:217-237 — 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) rules/api/http/rules/transport.go:129— rules/api/http/rules/transport.go:129-143 | rules/api/http/scripts/transport.go:109-124 | things/api/http/memberships/transport.go:117-132 | things/api/http/memberships/transport.go:134-149 | things/api/http/memberships/transport.go:151-166 | uiconfigs/api/http/groups/transport.go:90-104 — 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.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×5
Edited copy of a member (26 corresponding lines) cmd/postgres-writer/main.go:111— cmd/postgres-writer/main.go:111-136 | cmd/timescale-writer/main.go:109-134 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) filestore/api/http/transport.go:189— filestore/api/http/transport.go:189-214 | filestore/api/http/transport.go:289-315 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) things/redis/events/streams.go:25— things/redis/events/streams.go:25-51 | things/redis/events/streams.go:147-172 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) things/service.go:759— things/service.go:759-784 | things/service.go:786-811 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) things/api/http/things/endpoint.go:226— things/api/http/things/endpoint.go:226-252 | webhooks/api/http/endpoint.go:15-40 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×5
Edited copy of a member (28 corresponding lines) modbus/api/http/endpoint.go:132— modbus/api/http/endpoint.go:132-161 | modbus/api/http/endpoint.go:163-190 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) downlinks/api/http/endpoint.go:16— downlinks/api/http/endpoint.go:16-48 | downlinks/api/http/endpoint.go:101-128 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) auth/postgres/orgs.go:36— auth/postgres/orgs.go:36-68 | auth/postgres/orgs.go:70-97 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) auth/api/http/orgs/endpoint.go:129— auth/api/http/orgs/endpoint.go:129-156 | things/api/http/groups/endpoint.go:222-249 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) auth/service.go:239— auth/service.go:239-266 | things/service.go:837-868 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×5
Edited copies of one member (4 members, 12+ corresponding lines) shadows/api/http/transport.go:72— shadows/api/http/transport.go:72-86 | things/api/http/things/transport.go:526-540 | uiconfigs/api/http/things/transport.go:90-104 | webhooks/api/http/transport.go:120-131 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) users/api/http/users/transport.go:343— users/api/http/users/transport.go:343-355 | users/api/http/users/transport.go:380-392 | users/api/http/users/transport.go:449-461 | users/api/http/users/transport.go:463-474 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) consumers/notifiers/api/http/requests.go:18— consumers/notifiers/api/http/requests.go:18-29 | downlinks/api/http/requests.go:33-44 | modbus/api/http/requests.go:38-49 | webhooks/api/http/requests.go:26-37 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) auth/api/grpc/client.go:369— auth/api/grpc/client.go:369-380 | auth/api/grpc/client.go:415-426 | auth/api/grpc/client.go:515-533 | auth/api/grpc/client.go:555-571 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 12+ corresponding lines) consumers/alarms/postgres/alarms.go:196— consumers/alarms/postgres/alarms.go:196-207 | consumers/notifiers/postgres/notifiers.go:181-192 | rules/postgres/rules.go:229-240 | rules/postgres/scripts.go:171-185 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×5
Edited copy of a member (13 corresponding lines) ws/adapter.go:108— ws/adapter.go:108-121 | ws/adapter.go:131-143 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) users/api/http/users/endpoint.go:90— users/api/http/users/endpoint.go:90-102 | users/api/http/users/endpoint.go:177-189 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) http/adapter.go:90— http/adapter.go:90-103 | http/adapter.go:105-117 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) downlinks/service.go:435— downlinks/service.go:435-451 | modbus/service.go:694-706 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) auth/api/http/backup/responses.go:10— auth/api/http/backup/responses.go:10-22 | auth/api/http/orgs/responses.go:11-23 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) pkg/messaging/nats/pubsub.go:121— pkg/messaging/nats/pubsub.go:121-131 | pkg/messaging/nats/pubsub.go:161-171 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) auth/postgres/orgs.go:292— auth/postgres/orgs.go:292-302 | things/postgres/groups.go:362-372 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) auth/postgres/orgs.go:280— auth/postgres/orgs.go:280-290 | things/postgres/groups.go:350-360 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) things/api/http/profiles/requests.go:158— things/api/http/profiles/requests.go:158-168 | things/api/http/things/requests.go:224-234 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) filestore/postgres/things.go:275— filestore/postgres/things.go:275-285 | things/postgres/memberships.go:145-155 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (21 lines × 2) cli/groups.go:127— cli/groups.go:127-147 | cli/org_memberships.go:28-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/groups.go:127` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 2) cmd/smpp-notifier/main.go:256— cmd/smpp-notifier/main.go:256-276 | cmd/smtp-notifier/main.go:246-266 — `cmd/smpp-notifier/main.go` and `cmd/smtp-notifier/main.go` 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 19 separate duplicated blocks between them, totalling at least 223 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/smpp-notifier/main.go:256` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 2) http/api/transport.go:141— http/api/transport.go:141-161 | http/api/transport.go:179-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) things/api/http/memberships/requests.go:44— things/api/http/memberships/requests.go:44-64 | things/api/http/memberships/requests.go:80-100 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) cmd/rules/main.go:47— cmd/rules/main.go:47-67 | cmd/webhooks/main.go:54-74 — `cmd/rules/main.go` and `cmd/webhooks/main.go` 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 174 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) auth/emailer/logging.go:25— auth/emailer/logging.go:25-31 | things/emailer/logging.go:25-31 | users/emailer/logging.go:25-31 | users/emailer/logging.go:39-45 | users/emailer/logging.go:53-59 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/emailer/logging.go:25` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) auth/postgres/invites.go:49— auth/postgres/invites.go:49-55 | auth/postgres/invites.go:86-92 | auth/postgres/invites.go:546-552 | auth/postgres/memberships.go:183-189 | consumers/alarms/postgres/alarms.go:48-54 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `consumers/alarms/postgres/alarms.go:56` calls `Wrap` and `auth/postgres/invites.go:56` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 5) auth/api/http/keys/transport.go:108— auth/api/http/keys/transport.go:108-114 | users/api/http/users/transport.go:227-234 | users/api/http/users/transport.go:489-496 | users/api/http/users/transport.go:498-505 | users/api/http/users/transport.go:507-514 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `auth/api/http/keys/transport.go:117` calls `Header`, `Set` and `users/api/http/users/transport.go:517` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 5) auth/api/http/orgs/requests.go:57— auth/api/http/orgs/requests.go:57-63 | things/api/http/groups/requests.go:108-114 | things/api/http/profiles/requests.go:144-150 | things/api/http/things/requests.go:192-198 | users/api/http/invites/requests.go:115-121 — 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 (7 lines × 5) cmd/downlinks/main.go:123— cmd/downlinks/main.go:123-129 | cmd/filestore/main.go:152-158 | cmd/modbus/main.go:121-127 | cmd/shadows/main.go:118-124 | cmd/uiconfigs/main.go:117-123 — `cmd/downlinks/main.go` and `cmd/filestore/main.go` 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 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 3) audit/postgres/events.go:57— audit/postgres/events.go:57-63 | audit/postgres/events.go:89-95 | audit/postgres/events.go:122-128 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `audit/postgres/events.go:88` calls `orgQuery` and `audit/postgres/events.go:56` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) auth/postgres/invites.go:206— auth/postgres/invites.go:206-212 | things/postgres/groups.go:118-124 | things/postgres/things.go:300-306 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `things/postgres/groups.go:126` calls `Wrap` and `auth/postgres/invites.go:213` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) coap/api/metrics.go:54— coap/api/metrics.go:54-60 | http/api/metrics.go:45-51 | ws/api/metrics.go:63-69 — before extracting anything, compare `http/api/metrics.go` and `ws/api/metrics.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) coap/api/metrics.go:63— coap/api/metrics.go:63-69 | http/api/metrics.go:54-60 | ws/api/metrics.go:81-87 — before extracting anything, compare `http/api/metrics.go` and `ws/api/metrics.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 3) pkg/events/schema.go:139— pkg/events/schema.go:139-145 | pkg/events/schema.go:179-185 | pkg/events/schema.go:268-274 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/events/schema.go:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D12 · Dependency Hygiene· Dependency pinned to a stale untagged commit · ×4
Dependency pinned to a stale untagged commit: github.com/fiorix/go-smpp — Direct dependency `github.com/fiorix/go-smpp` is required at `v0.0.0-20210403173735-2894b96e70ba` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2021-04-03, 5.6 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/fiorix/go-smpp` and has not moved this requirement in 5.6 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/fiorix/go-smpp` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Dependency pinned to a stale untagged commit: github.com/hokaccha/go-prettyjson — Direct dependency `github.com/hokaccha/go-prettyjson` is required at `v0.0.0-20211117102719-0474bc63780f` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2021-11-17, 5 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/hokaccha/go-prettyjson` and has not moved this requirement in 5 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/hokaccha/go-prettyjson` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Dependency pinned to a stale untagged commit: github.com/jackc/pgerrcode — Direct dependency `github.com/jackc/pgerrcode` is required at `v0.0.0-20220416144525-469b46aa5efa` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2022-04-16, 4.6 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/jackc/pgerrcode` and has not moved this requirement in 4.6 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/jackc/pgerrcode` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Dependency pinned to a stale untagged commit: gopkg.in/gomail.v2 — Direct dependency `gopkg.in/gomail.v2` is required at `v2.0.0-20160411212932-81ebce5c23df` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2016-04-11, 10.6 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `gopkg.in/gomail.v2` and has not moved this requirement in 10.6 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `gopkg.in/gomail.v2` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Hotspot: converters/service.go converters/service.go:390— converters/service.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in converters.parseJSONRecord at line 390. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:22:53 +01:00' --until='2026-11-16 12:22:53 +01:00' --full-history --no-merges -- converters/service.go`: 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: filestore/api/http/transport.go filestore/api/http/transport.go:715— filestore/api/http/transport.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in http.parseFileName at line 715. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:22:53 +01:00' --until='2026-11-16 12:22:53 +01:00' --full-history --no-merges -- filestore/api/http/transport.go`: 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: REDACTED REDACTED:67— REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in thingsService.CreateGroupMemberships at line 67. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:22:53 +01:00' --until='2026-11-16 12:22:53 +01:00' --full-history --no-merges -- REDACTED`: 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: filestore/postgres/groups.go filestore/postgres/groups.go:131— filestore/postgres/groups.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in groupsRepository.RetrieveByGroup at line 131. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 12:22:53 +01:00' --until='2026-11-16 12:22:53 +01:00' --full-history --no-merges -- filestore/postgres/groups.go`: 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.
ClassTooLong: usersService users/service.go:179— ClassTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods, 39 blocks, lines 179-1293. The bar is 400 significant lines; this is 230 over it, 1.58× 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: loggingMiddleware things/api/logging.go:21— ClassTooLong — 555 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods, 58 blocks, lines 21-809. The bar is 400 significant lines; this is 155 over it, 1.39× 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: thingsService things/service.go:205— ClassTooLong — 549 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods, 51 blocks, lines 205-1172. The bar is 400 significant lines; this is 149 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: loggingMiddleware auth/api/logging.go:20— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods, 43 blocks, lines 20-621. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×4
Edited copy of a member (36 corresponding lines) readers/api/http/messages/endpoint.go:68— readers/api/http/messages/endpoint.go:68-103 | readers/api/http/messages/endpoint.go:105-140 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) pkg/sdk/go/invites.go:20— pkg/sdk/go/invites.go:20-61 | pkg/sdk/go/keys.go:30-65 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) coap/adapter.go:23— coap/adapter.go:23-71 | ws/adapter.go:19-54 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) cmd/postgres-writer/main.go:28— cmd/postgres-writer/main.go:28-64 | cmd/timescale-writer/main.go:28-63 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×4
Edited copy of a member (35 corresponding lines) certs/postgres/certs.go:32— certs/postgres/certs.go:32-66 | certs/postgres/certs.go:210-252 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) auth/api/http/backup/endpoint.go:46— auth/api/http/backup/endpoint.go:46-86 | auth/api/http/backup/endpoint.go:88-122 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) downlinks/service.go:397— downlinks/service.go:397-433 | modbus/service.go:658-692 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) auth/postgres/orgs.go:99— auth/postgres/orgs.go:99-139 | things/postgres/groups.go:110-144 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×4
Edited copy of a member (27 corresponding lines) downlinks/service.go:224— downlinks/service.go:224-250 | modbus/service.go:472-498 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) cmd/http/main.go:126— cmd/http/main.go:126-158 | REDACTED:109-135 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) certs/postgres/certs.go:93— certs/postgres/certs.go:93-128 | certs/postgres/certs.go:130-156 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (27 corresponding lines) filestore/api/http/transport.go:216— filestore/api/http/transport.go:216-242 | filestore/api/http/transport.go:317-344 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×4
Edited copy of a member (31 corresponding lines) downlinks/service.go:286— downlinks/service.go:286-317 | modbus/service.go:534-564 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) things/api/http/profiles/requests.go:32— things/api/http/profiles/requests.go:32-64 | things/api/http/things/requests.go:33-63 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) modbus/api/http/requests.go:336— modbus/api/http/requests.go:336-372 | modbus/api/http/requests.go:389-419 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) cmd/converters/main.go:32— cmd/converters/main.go:32-68 | cmd/http/main.go:31-61 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×4
Edited copy of a member (23 corresponding lines) users/service.go:715— users/service.go:715-745 | users/service.go:747-769 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rules/rules.go:134— rules/rules.go:134-156 | rules/rules.go:176-198 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) certs/postgres/certs.go:68— certs/postgres/certs.go:68-91 | things/postgres/things.go:264-286 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) rules/api/http/scripts/requests.go:32— rules/api/http/scripts/requests.go:32-60 | rules/api/http/scripts/requests.go:103-125 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×4
Edited copy of a member (18 corresponding lines) users/api/logging.go:333— users/api/logging.go:333-350 | users/api/logging.go:352-369 — 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) auth/api/http/orgs/transport.go:104— auth/api/http/orgs/transport.go:104-121 | things/api/http/groups/transport.go:192-209 — 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) things/groups.go:213— things/groups.go:213-230 | things/service.go:573-591 — 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) filestore/api/http/transport.go:244— filestore/api/http/transport.go:244-261 | filestore/api/http/transport.go:346-364 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×4
Edited copies of one member (4 members, 14+ corresponding lines) things/api/http/groups/endpoint.go:192— things/api/http/groups/endpoint.go:192-205 | things/api/http/profiles/endpoint.go:184-198 | things/api/http/things/endpoint.go:254-268 | things/api/http/things/endpoint.go:321-334 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) readers/api/http/messages/endpoint.go:142— readers/api/http/messages/endpoint.go:142-155 | readers/api/http/messages/endpoint.go:157-170 | readers/api/http/messages/endpoint.go:172-185 | readers/api/http/messages/endpoint.go:187-200 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) auth/postgres/key.go:29— auth/postgres/key.go:29-44 | auth/postgres/roles.go:26-40 | auth/postgres/sessions.go:30-43 | users/postgres/identity.go:31-44 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) users/postgres/identity.go:46— users/postgres/identity.go:46-59 | users/postgres/users.go:105-121 | users/postgres/users.go:123-139 | users/postgres/verifications.go:61-81 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×4
Edited copies of one member (3 members, 15+ corresponding lines) things/api/http/groups/endpoint.go:136— things/api/http/groups/endpoint.go:136-150 | things/api/http/profiles/endpoint.go:109-124 | things/api/http/things/endpoint.go:112-127 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) things/api/grpc/endpoint.go:37— things/api/grpc/endpoint.go:37-51 | things/api/grpc/endpoint.go:217-231 | things/api/grpc/endpoint.go:233-247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) pkg/events/schema.go:113— pkg/events/schema.go:113-128 | pkg/events/schema.go:159-173 | pkg/events/schema.go:248-262 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) uiconfigs/postgres/groups.go:209— uiconfigs/postgres/groups.go:209-223 | uiconfigs/postgres/orgs.go:209-223 | uiconfigs/postgres/things.go:224-239 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 12+ corresponding lines) · ×4
Edited copies of one member (5 members, 12+ corresponding lines) modbus/api/http/transport.go:149— modbus/api/http/transport.go:149-160 | modbus/api/http/transport.go:314-325 | modbus/api/http/transport.go:327-338 | modbus/api/http/transport.go:340-354 | modbus/api/http/transport.go:356-370 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 12+ corresponding lines) downlinks/service.go:165— downlinks/service.go:165-176 | downlinks/service.go:178-189 | modbus/service.go:231-242 | modbus/service.go:244-255 | shadows/service.go:84-96 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 12+ corresponding lines) consumers/alarms/service.go:138— consumers/alarms/service.go:138-149 | consumers/notifiers/service.go:191-207 | uiconfigs/service.go:209-227 | uiconfigs/service.go:285-296 | webhooks/service.go:176-192 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 12+ corresponding lines) certs/service.go:291— certs/service.go:291-303 | consumers/alarms/service.go:125-136 | downlinks/service.go:191-202 | modbus/service.go:257-268 | uiconfigs/service.go:169-180 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×4
Edited copies of one member (3 members, 12+ corresponding lines) downlinks/api/http/transport.go:110— downlinks/api/http/transport.go:110-121 | downlinks/api/http/transport.go:197-211 | downlinks/api/http/transport.go:213-227 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) filestore/service.go:265— filestore/service.go:265-277 | filestore/service.go:393-404 | filestore/service.go:406-423 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) coap/adapter.go:84— coap/adapter.go:84-95 | converters/service.go:482-495 | http/adapter.go:52-63 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) things/groups.go:278— things/groups.go:278-289 | things/service.go:908-919 | things/service.go:921-932 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×4
Edited copies of one member (3 members, 8+ corresponding lines) coap/api/metrics.go:53— coap/api/metrics.go:53-60 | http/api/metrics.go:44-51 | ws/api/metrics.go:62-69 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) coap/api/metrics.go:62— coap/api/metrics.go:62-69 | http/api/metrics.go:53-60 | ws/api/metrics.go:80-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) coap/api/metrics.go:35— coap/api/metrics.go:35-42 | http/api/metrics.go:35-42 | ws/api/metrics.go:35-42 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) readers/api/http/transport.go:22— readers/api/http/transport.go:22-29 | rules/api/http/transport.go:21-30 | users/api/http/transport.go:23-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×4
Edited copies of one member (3 members, 7+ corresponding lines) consumers/writers/api/metrics.go:34— consumers/writers/api/metrics.go:34-40 | rules/api/metrics.go:129-136 | shadows/api/metrics.go:71-78 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) auth/postgres/sessions.go:128— auth/postgres/sessions.go:128-136 | rules/postgres/rules.go:253-261 | shadows/postgres/shadows.go:111-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) shadows/tracing/shadows.go:49— shadows/tracing/shadows.go:49-55 | things/tracing/profiles.go:79-85 | uiconfigs/tracing/things.go:47-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) auth/emailer/metrics.go:10— auth/emailer/metrics.go:10-16 | things/emailer/metrics.go:10-16 | users/emailer/metrics.go:10-16 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (22 lines × 2) converters/service.go:113— converters/service.go:113-134 | converters/service.go:235-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `converters/service.go:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) downlinks/postgres/downlinks.go:85— downlinks/postgres/downlinks.go:85-106 | downlinks/postgres/downlinks.go:130-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `downlinks/postgres/downlinks.go:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `thingID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (22 lines × 2) pkg/sdk/go/messages.go:383— pkg/sdk/go/messages.go:383-404 | pkg/sdk/go/messages.go:454-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/messages.go:383` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (22 lines × 2) REDACTED:73— REDACTED:73-94 | REDACTED:258-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) auth/postgres/memberships.go:218— auth/postgres/memberships.go:218-237 | things/postgres/memberships.go:185-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/memberships.go:218` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) consumers/writers/postgres/consumer.go:109— consumers/writers/postgres/consumer.go:109-128 | consumers/writers/timescale/consumer.go:109-128 — `consumers/writers/postgres/consumer.go` and `consumers/writers/timescale/consumer.go` 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 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/writers/postgres/consumer.go:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) filestore/postgres/groups.go:147— filestore/postgres/groups.go:147-166 | filestore/postgres/things.go:145-164 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `groupID` in one and `thingID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) pkg/sdk/go/messages.go:74— pkg/sdk/go/messages.go:74-93 | pkg/sdk/go/messages.go:98-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/messages.go:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) cmd/alarms/main.go:183— cmd/alarms/main.go:183-196 | cmd/modbus/main.go:181-194 | cmd/webhooks/main.go:182-195 — `cmd/alarms/main.go` and `cmd/modbus/main.go` 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 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:183` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) users/api/http/backup/transport.go:78— users/api/http/backup/transport.go:78-91 | users/api/http/invites/transport.go:158-171 | users/api/http/users/transport.go:517-530 — `users/api/http/backup/transport.go` and `users/api/http/invites/transport.go` 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 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 3) things/api/http/groups/transport.go:259— things/api/http/groups/transport.go:259-272 | things/api/http/profiles/transport.go:309-322 | things/api/http/things/transport.go:407-420 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) things/api/http/groups/transport.go:288— things/api/http/groups/transport.go:288-301 | things/api/http/profiles/transport.go:353-366 | things/api/http/things/transport.go:466-479 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) readers/postgres/json.go:162— readers/postgres/json.go:162-174 | readers/postgres/senml.go:204-216 | readers/timescale/senml.go:210-222 — before extracting anything, compare `readers/postgres/json.go` and `readers/postgres/senml.go` as WHOLE FILES: this scan already matched 4 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 3) things/api/http/groups/transport.go:245— things/api/http/groups/transport.go:245-257 | things/api/http/profiles/transport.go:280-292 | things/api/http/things/transport.go:363-375 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) things/api/http/groups/transport.go:274— things/api/http/groups/transport.go:274-286 | things/api/http/profiles/transport.go:324-336 | things/api/http/things/transport.go:422-434 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) uiconfigs/api/http/groups/transport.go:76— uiconfigs/api/http/groups/transport.go:76-88 | uiconfigs/api/http/orgs/transport.go:77-89 | uiconfigs/api/http/things/transport.go:76-88 — `uiconfigs/api/http/groups/transport.go` and `uiconfigs/api/http/orgs/transport.go` 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 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 (10 lines × 3) auth/postgres/invites.go:494— auth/postgres/invites.go:494-503 | filestore/postgres/groups.go:64-74 | filestore/postgres/things.go:65-75 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) users/api/http/backup/transport.go:94— users/api/http/backup/transport.go:94-103 | users/api/http/invites/transport.go:174-183 | users/api/http/users/transport.go:613-622 — `users/api/http/backup/transport.go` and `users/api/http/invites/transport.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `users/api/http/backup/transport.go:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) consumers/alarms/api/http/transport.go:316— consumers/alarms/api/http/transport.go:316-325 | consumers/notifiers/api/http/transport.go:271-280 | rules/api/http/rules/transport.go:280-289 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) converters/api/transport.go:140— converters/api/transport.go:140-149 | http/api/transport.go:226-235 | ws/api/transport.go:133-142 — 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.
Change coupling: endpoint.go ↔ profiles.go things/api/grpc/endpoint.go:1— `things/api/grpc/endpoint.go` and `things/profiles.go` 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 — 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 `5d4569a6` MF-840 - Remove write flag from profile config (#845); `4517f608` MF-237 - Remove Webhook field from Config Profile; `11b39aea` MF-237 - Change Message Rules type to []string — run `git show` on any of them.
Change coupling: transport.go ↔ metrics.go users/api/http/transport.go:1— `users/api/http/transport.go` and `users/api/metrics.go` change together 54% of the time (7 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 7 shared commits counted here, the most recent 3 are `59e315ad` MF-910 - Introduce ability to invite user to Org when sending Platfor… (at that commit the file was still `users/api/http/metrics.go`); `9836880f` MF-777 - Refactor building URLs in user-facing e-mails (#776) (at that commit the file was still `users/api/http/metrics.go`); `02bc7553` MF-746 - Require e-mail address verification during the self-register… (at that commit the file was still `users/api/http/metrics.go`) — run `git show` on any of them.
Change coupling: requests.go ↔ streams.go things/api/grpc/requests.go:1— `things/api/grpc/requests.go` and `things/redis/events/streams.go` change together 53% of the time (8 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 — 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 `db021f14` MF-1222 - CanUserAccessThings gRPC method (#1324); `b2a23657` MF-884 - Add CanUserAccessGroupThings gRPC method (#885) (at that commit the file was still `things/redis/streams.go`); `c4be820e` MF-586 - Split Authorize method (#591) (at that commit the file was still `things/redis/streams.go`) — run `git show` on any of them.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×3
Edited copies of one member (3 members, 30+ corresponding lines) audit/postgres/events.go:54— audit/postgres/events.go:54-83 | audit/postgres/events.go:85-116 | audit/postgres/events.go:118-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 30+ corresponding lines) auth/postgres/invites.go:159— auth/postgres/invites.go:159-198 | auth/postgres/invites.go:234-267 | rules/postgres/scripts.go:243-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 30+ corresponding lines) readers/api/http/messages/transport.go:210— readers/api/http/messages/transport.go:210-240 | readers/api/http/messages/transport.go:412-441 | readers/api/http/messages/transport.go:443-472 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×3
Edited copy of a member (33 corresponding lines) filestore/service.go:156— filestore/service.go:156-192 | filestore/service.go:279-311 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) users/postgres/users.go:35— users/postgres/users.go:35-68 | users/postgres/verifications.go:27-59 — These two members are one piece of code written twice and then edited apart: 33 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 (33 corresponding lines) users/api/http/backup/endpoint.go:45— users/api/http/backup/endpoint.go:45-79 | users/api/http/backup/endpoint.go:81-113 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 14+ corresponding lines) · ×3
Edited copies of one member (5 members, 14+ corresponding lines) consumers/notifiers/postgres/notifiers.go:131— consumers/notifiers/postgres/notifiers.go:131-144 | downlinks/postgres/downlinks.go:225-241 | modbus/postgres/clients.go:208-224 | things/postgres/things.go:84-99 | webhooks/postgres/webhooks.go:133-147 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 14+ corresponding lines) auth/api/http/backup/endpoint.go:28— auth/api/http/backup/endpoint.go:28-44 | downlinks/api/http/backup/endpoint.go:35-50 | readers/api/http/backup/endpoint.go:44-62 | things/api/http/things/endpoint.go:306-319 | users/api/http/backup/endpoint.go:28-43 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 14+ corresponding lines) auth/api/grpc/endpoint.go:61— auth/api/grpc/endpoint.go:61-74 | auth/api/grpc/endpoint.go:76-89 | auth/api/grpc/endpoint.go:225-239 | auth/api/grpc/endpoint.go:282-296 | auth/api/grpc/endpoint.go:320-335 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) auth/api/grpc/endpoint.go:91— auth/api/grpc/endpoint.go:91-115 | auth/api/grpc/endpoint.go:117-136 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) auth/api/grpc/client.go:605— auth/api/grpc/client.go:605-625 | auth/api/grpc/server.go:444-463 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) consumers/alarms/api/http/requests.go:18— consumers/alarms/api/http/requests.go:18-37 | rules/api/validation.go:12-31 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×3
Edited copies of one member (3 members, 17+ corresponding lines) things/groups.go:186— things/groups.go:186-202 | things/service.go:392-408 | things/service.go:528-544 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) things/groups.go:295— things/groups.go:295-316 | things/service.go:419-435 | things/service.go:510-526 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) things/groups.go:318— things/groups.go:318-339 | things/service.go:360-376 | things/service.go:555-571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×3
Edited copies of one member (3 members, 14+ corresponding lines) rules/api/http/rules/endpoint.go:139— rules/api/http/rules/endpoint.go:139-152 | rules/api/http/rules/endpoint.go:154-167 | things/api/http/things/endpoint.go:270-284 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) users/api/http/users/endpoint.go:191— users/api/http/users/endpoint.go:191-204 | users/api/http/users/endpoint.go:206-220 | users/api/http/users/endpoint.go:318-332 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) auth/api/http/invites/endpoint.go:38— auth/api/http/invites/endpoint.go:38-54 | auth/api/http/invites/endpoint.go:56-69 | users/api/http/invites/endpoint.go:103-116 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×3
Edited copy of a member (16 corresponding lines) consumers/notifiers/postgres/notifiers.go:233— consumers/notifiers/postgres/notifiers.go:233-248 | things/postgres/things.go:484-500 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) modbus/api/http/endpoint.go:237— modbus/api/http/endpoint.go:237-252 | modbus/api/http/endpoint.go:254-269 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) auth/postgres/orgs.go:308— auth/postgres/orgs.go:308-323 | things/postgres/profiles.go:308-325 — 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 copies of one member (3 members, 13+ corresponding lines) · ×3
Edited copies of one member (3 members, 13+ corresponding lines) certs/events/handler.go:22— certs/events/handler.go:22-34 | readers/events/handler.go:22-34 | shadows/events/handler.go:22-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) uiconfigs/api/http/groups/endpoint.go:75— uiconfigs/api/http/groups/endpoint.go:75-87 | uiconfigs/api/http/orgs/endpoint.go:75-87 | uiconfigs/api/http/things/endpoint.go:77-89 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) uiconfigs/postgres/groups.go:167— uiconfigs/postgres/groups.go:167-179 | uiconfigs/postgres/orgs.go:167-179 | uiconfigs/postgres/things.go:181-193 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (27 lines × 2) pkg/sdk/go/groups.go:146— pkg/sdk/go/groups.go:146-172 | pkg/sdk/go/profiles.go:71-97 — before extracting anything, compare `pkg/sdk/go/groups.go` and `pkg/sdk/go/profiles.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/groups.go:146` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (27 lines × 2) pkg/sdk/go/profiles.go:101— pkg/sdk/go/profiles.go:101-127 | pkg/sdk/go/profiles.go:131-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/profiles.go:101` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (27 lines × 2) pkg/sdk/go/webhooks.go:52— pkg/sdk/go/webhooks.go:52-78 | pkg/sdk/go/webhooks.go:82-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/webhooks.go:52` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (19 lines × 2) consumers/writers/postgres/consumer.go:65— consumers/writers/postgres/consumer.go:65-83 | consumers/writers/timescale/consumer.go:65-83 — `consumers/writers/postgres/consumer.go` and `consumers/writers/timescale/consumer.go` 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 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/writers/postgres/consumer.go:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) converters/api/transport.go:65— converters/api/transport.go:65-83 | converters/api/transport.go:101-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (19 lines × 2) downlinks/api/http/backup/transport.go:67— downlinks/api/http/backup/transport.go:67-85 | uiconfigs/api/http/backup/transport.go:68-86 — before extracting anything, compare `downlinks/api/http/backup/transport.go` and `uiconfigs/api/http/backup/transport.go` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 3) things/api/http/groups/endpoint.go:66— things/api/http/groups/endpoint.go:66-82 | things/api/http/groups/endpoint.go:92-108 | things/api/http/groups/endpoint.go:118-134 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `things/api/http/groups/endpoint.go:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) consumers/notifiers/api/http/requests.go:143— consumers/notifiers/api/http/requests.go:143-159 | rules/api/http/scripts/requests.go:132-148 | rules/api/http/scripts/requests.go:173-189 — 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 (17 lines × 3) downlinks/api/http/requests.go:195— downlinks/api/http/requests.go:195-211 | modbus/api/http/requests.go:466-482 | webhooks/api/http/requests.go:174-190 — 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 (16 lines × 2) consumers/alarms/api/http/transport.go:299— consumers/alarms/api/http/transport.go:299-314 | readers/api/http/messages/transport.go:495-510 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/api/http/transport.go:299` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) converters/service.go:137— converters/service.go:137-152 | converters/service.go:259-274 — both copies are in the same file, so extract the block into 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) pkg/sdk/go/group_memberships.go:22— pkg/sdk/go/group_memberships.go:22-37 | pkg/sdk/go/things.go:327-342 — before extracting anything, compare `pkg/sdk/go/group_memberships.go` and `pkg/sdk/go/things.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/group_memberships.go:22` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 3) pkg/sdk/go/certs.go:69— pkg/sdk/go/certs.go:69-79 | pkg/sdk/go/certs.go:96-108 | pkg/sdk/go/certs.go:151-164 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/certs.go:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) things/api/http/backup/transport.go:97— things/api/http/backup/transport.go:97-107 | things/api/http/groups/transport.go:354-364 | things/api/http/things/transport.go:570-580 — `things/api/http/groups/transport.go` and `things/api/http/things/transport.go` 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 137 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 3) cmd/auth/main.go:413— cmd/auth/main.go:413-423 | cmd/things/main.go:448-458 | cmd/users/main.go:372-382 — `cmd/auth/main.go` and `cmd/things/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/auth/main.go:413` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) cmd/auth/main.go:284— cmd/auth/main.go:284-292 | cmd/smtp-notifier/main.go:219-227 | cmd/things/main.go:329-337 | cmd/users/main.go:276-284 — 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 (9 lines × 4) cmd/downlinks/main.go:115— cmd/downlinks/main.go:115-123 | cmd/modbus/main.go:113-121 | cmd/shadows/main.go:110-118 | cmd/uiconfigs/main.go:109-117 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 4) consumers/alarms/events/handler.go:22— consumers/alarms/events/handler.go:22-30 | filestore/events/handler.go:22-30 | mqtt/redis/events/handler.go:22-30 | webhooks/events/handler.go:22-30 — 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 × 3) auth/api/validation.go:13— auth/api/validation.go:13-20 | rules/api/validation.go:13-20 | things/api/validation.go:13-20 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) auth/postgres/roles.go:96— auth/postgres/roles.go:96-104 | filestore/postgres/groups.go:236-243 | filestore/postgres/things.go:234-242 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) cmd/filestore/main.go:340— cmd/filestore/main.go:340-347 | cmd/modbus/main.go:279-286 | cmd/rules/main.go:276-283 — `cmd/filestore/main.go` and `cmd/modbus/main.go` 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 153 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/filestore/main.go:340` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) coap/api/metrics.go:37— coap/api/metrics.go:37-42 | http/api/metrics.go:37-42 | ws/api/metrics.go:37-42 — before extracting anything, compare `http/api/metrics.go` and `ws/api/metrics.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `coap/api/metrics.go:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 3) consumers/alarms/postgres/alarms.go:105— consumers/alarms/postgres/alarms.go:105-110 | consumers/alarms/postgres/alarms.go:136-141 | consumers/alarms/postgres/alarms.go:232-237 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) consumers/notifiers/service.go:194— consumers/notifiers/service.go:194-199 | uiconfigs/service.go:287-293 | webhooks/service.go:179-184 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Low cohesion: grpcServer (LCOM4 19) auth/api/grpc/server.go:24— grpcServer's methods fall into 19 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 19 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: grpcServer (LCOM4 18) things/api/grpc/server.go:25— grpcServer's methods fall into 18 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 18 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: grpcClient (LCOM4 8) things/api/grpc/client.go:23— grpcClient's methods fall into 8 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 8 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.
X3 · Exception handling· Lost error (reports an error that is nil on this path) · ×3
Lost error (reports an error that is nil on this path) webhooks/postgres/webhooks.go:165— `case pgerrcode.StringDataRightTruncationDataException` handles a failure of `pgErr` but reports `err`, which the earlier `if err != nil { return … }` already proved nil here: the real failure is lost and a nil error is reported (or returned as success) in its place. Report `pgErr`.
Lost error (reports an error that is nil on this path) things/service.go:960— `if groupErr != nil` handles a failure of `groupErr` but reports `err`, which the earlier `if err != nil { return … }` already proved nil here: the real failure is lost and a nil error is reported (or returned as success) in its place. Report `groupErr`.
Lost error (reports an error that is nil on this path) things/postgres/things.go:432— `case pgerrcode.StringDataRightTruncationDataException` handles a failure of `pgErr` but reports `err`, which the earlier `if err != nil { return … }` already proved nil here: the real failure is lost and a nil error is reported (or returned as success) in its place. Report `pgErr`.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (8 members, 50+ identical tokens) consumers/alarms/api/http/transport.go:220— consumers/alarms/api/http/transport.go:220-235 | consumers/notifiers/api/http/transport.go:221-235 | rules/api/http/rules/transport.go:203-217 | rules/api/http/scripts/transport.go:158-173 | things/api/http/profiles/transport.go:164-178 | things/api/http/things/transport.go:247-261 | things/api/http/things/transport.go:263-278 | webhooks/api/http/transport.go:265-280 — 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) pkg/sdk/go/group_memberships.go:39— pkg/sdk/go/group_memberships.go:39-61 | pkg/sdk/go/groups.go:250-272 | pkg/sdk/go/org_memberships.go:104-130 | pkg/sdk/go/orgs.go:78-100 | pkg/sdk/go/profiles.go:159-181 | pkg/sdk/go/things.go:210-233 | pkg/sdk/go/users.go:175-197 | pkg/sdk/go/webhooks.go:140-162 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) auth/api/http/backup/endpoint.go:12— auth/api/http/backup/endpoint.go:12-26 | downlinks/api/http/backup/endpoint.go:18-33 | readers/api/http/backup/endpoint.go:17-42 | things/api/http/backup/endpoint.go:16-30 | uiconfigs/api/http/backup/endpoint.go:20-35 — 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) auth/emailer/logging.go:22— auth/emailer/logging.go:22-34 | things/emailer/logging.go:22-34 | users/emailer/logging.go:22-34 | users/emailer/logging.go:36-48 | users/emailer/logging.go:50-62 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) downlinks/postgres/downlinks.go:73— downlinks/postgres/downlinks.go:73-116 | downlinks/postgres/downlinks.go:118-161 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) REDACTED:256— REDACTED:256-301 | REDACTED:303-346 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) downlinks/service.go:132— downlinks/service.go:132-163 | modbus/service.go:179-216 — 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.
Edited copy of a member (32 corresponding lines) rules/postgres/rules.go:75— rules/postgres/rules.go:75-106 | rules/postgres/rules.go:108-144 — 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 copies of one member (4 members, 31+ corresponding lines) · ×2
Edited copies of one member (4 members, 31+ corresponding lines) pkg/sdk/go/invites.go:136— pkg/sdk/go/invites.go:136-177 | pkg/sdk/go/profiles.go:66-97 | pkg/sdk/go/things.go:84-116 | pkg/sdk/go/users.go:113-143 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 31+ corresponding lines) auth/postgres/memberships.go:204— auth/postgres/memberships.go:204-237 | rules/postgres/scripts.go:136-169 | things/postgres/memberships.go:173-204 | things/postgres/profiles.go:73-103 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 29+ corresponding lines) · ×2
Edited copies of one member (3 members, 29+ corresponding lines) consumers/alarms/api/http/endpoint.go:110— consumers/alarms/api/http/endpoint.go:110-138 | readers/api/http/messages/endpoint.go:202-231 | readers/api/http/messages/endpoint.go:233-262 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 29+ corresponding lines) modbus/api/http/endpoint.go:16— modbus/api/http/endpoint.go:16-49 | modbus/api/http/endpoint.go:51-82 | modbus/api/http/endpoint.go:192-220 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) auth/postgres/orgs.go:157— auth/postgres/orgs.go:157-179 | auth/postgres/orgs.go:203-233 | things/postgres/groups.go:264-286 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) pkg/sdk/go/messages.go:43— pkg/sdk/go/messages.go:43-69 | pkg/sdk/go/messages.go:71-93 | pkg/sdk/go/messages.go:95-117 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) readers/postgres/json.go:176— readers/postgres/json.go:176-204 | readers/timescale/json.go:75-111 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (29 corresponding lines) pkg/sdk/go/things.go:281— pkg/sdk/go/things.go:281-315 | pkg/sdk/go/users.go:145-173 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×2
Edited copies of one member (3 members, 26+ corresponding lines) uiconfigs/service.go:117— uiconfigs/service.go:117-142 | uiconfigs/service.go:182-207 | uiconfigs/service.go:258-283 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 26+ corresponding lines) consumers/notifiers/postgres/init.go:43— consumers/notifiers/postgres/init.go:43-69 | shadows/postgres/init.go:38-63 | webhooks/postgres/init.go:43-71 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) converters/api/transport.go:64— converters/api/transport.go:64-98 | converters/api/transport.go:100-133 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) mqtt/api/http/endpoint.go:13— mqtt/api/http/endpoint.go:13-46 | users/api/grpc/endpoint.go:14-48 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 21+ corresponding lines) · ×2
Edited copies of one member (4 members, 21+ corresponding lines) things/redis/profiles.go:45— things/redis/profiles.go:45-65 | things/redis/things.go:65-95 | things/redis/things.go:97-123 | things/redis/things.go:149-170 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 21+ corresponding lines) auth/api/http/invites/endpoint.go:12— auth/api/http/invites/endpoint.go:12-36 | auth/api/http/memberships/endpoint.go:50-73 | auth/api/http/orgs/endpoint.go:12-32 | auth/api/http/orgs/endpoint.go:60-81 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×2
Edited copies of one member (3 members, 22+ corresponding lines) things/api/http/profiles/endpoint.go:158— things/api/http/profiles/endpoint.go:158-182 | things/api/http/things/endpoint.go:178-201 | things/api/http/things/endpoint.go:203-224 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) rules/api/http/rules/transport.go:145— rules/api/http/rules/transport.go:145-168 | rules/api/http/rules/transport.go:170-192 | rules/api/http/scripts/transport.go:126-147 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×2
Edited copies of one member (3 members, 19+ corresponding lines) uiconfigs/api/http/groups/endpoint.go:48— uiconfigs/api/http/groups/endpoint.go:48-66 | uiconfigs/api/http/orgs/endpoint.go:48-66 | uiconfigs/api/http/things/endpoint.go:48-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) modbus/api/http/endpoint.go:281— modbus/api/http/endpoint.go:281-300 | rules/api/http/rules/endpoint.go:200-218 | rules/api/http/rules/endpoint.go:233-251 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×2
Edited copies of one member (4 members, 15+ corresponding lines) things/api/http/groups/transport.go:149— things/api/http/groups/transport.go:149-163 | things/api/http/profiles/transport.go:148-162 | things/api/http/things/transport.go:230-245 | things/api/http/things/transport.go:497-511 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 15+ corresponding lines) filestore/api/http/endpoint.go:15— filestore/api/http/endpoint.go:15-33 | filestore/api/http/endpoint.go:35-49 | filestore/api/http/endpoint.go:117-135 | filestore/api/http/endpoint.go:137-151 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 12+ corresponding lines) · ×2
Edited copies of one member (6 members, 12+ corresponding lines) rules/service.go:265— rules/service.go:265-280 | rules/service.go:301-312 | rules/service.go:314-327 | rules/service.go:378-389 | rules/service.go:391-404 | webhooks/service.go:163-174 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
Edited copies of one member (6 members, 12+ corresponding lines) auth/api/grpc/client.go:462— auth/api/grpc/client.go:462-473 | auth/api/grpc/client.go:661-672 | auth/api/grpc/client.go:692-703 | things/api/grpc/client.go:218-229 | things/api/grpc/client.go:331-343 | users/api/grpc/client.go:72-83 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) users/api/logging.go:371— users/api/logging.go:371-379 | users/api/logging.go:381-389 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) certs/api/endpoint.go:109— certs/api/endpoint.go:109-117 | http/api/endpoint.go:13-23 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) http/adapter.go:65— http/adapter.go:65-76 | http/adapter.go:78-88 | ws/adapter.go:99-106 | ws/adapter.go:123-129 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) auth/tracing/keys.go:58— auth/tracing/keys.go:58-64 | auth/tracing/orgs.go:56-62 | filestore/tracing/groups.go:79-85 | filestore/tracing/things.go:82-88 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (27 lines × 3) pkg/sdk/go/groups.go:116— pkg/sdk/go/groups.go:116-142 | pkg/sdk/go/things.go:90-116 | pkg/sdk/go/things.go:120-146 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/groups.go:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `sdk mfSDK) ListThingsByGroup(groupID` in one and `sdk mfSDK) ListThingsByProfile(prID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (27 lines × 3) pkg/sdk/go/groups.go:222— pkg/sdk/go/groups.go:222-248 | pkg/sdk/go/groups.go:276-302 | pkg/sdk/go/groups.go:306-332 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/groups.go:222` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (25 lines × 2) converters/service.go:187— converters/service.go:187-211 | converters/service.go:281-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. Read the line range as the matched WINDOW rather than a finished unit: at `converters/service.go:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (25 lines × 2) modbus/postgres/clients.go:119— modbus/postgres/clients.go:119-143 | modbus/postgres/clients.go:169-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. Read the line range as the matched WINDOW rather than a finished unit: at `modbus/postgres/clients.go:119` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `thingID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 2) cmd/coap/main.go:161— cmd/coap/main.go:161-178 | REDACTED:111-128 — `cmd/coap/main.go` and `REDACTED` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/coap/main.go:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) readers/api/http/messages/requests.go:90— readers/api/http/messages/requests.go:90-107 | readers/api/http/messages/requests.go:117-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 11) cmd/alarms/main.go:217— cmd/alarms/main.go:217-231 | cmd/converters/main.go:170-184 | cmd/downlinks/main.go:217-231 | cmd/modbus/main.go:215-229 | cmd/mqtt/main.go:301-315 | cmd/postgres-reader/main.go:212-226 | cmd/rules/main.go:210-224 | cmd/shadows/main.go:214-228 | cmd/timescale-reader/main.go:187-201 | cmd/uiconfigs/main.go:204-218 | cmd/webhooks/main.go:216-230 — `cmd/alarms/main.go` and `cmd/converters/main.go` 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 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:217` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/alarms/main.go:233` calls `Env` and `cmd/downlinks/main.go:233` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 11) pkg/sdk/go/group_memberships.go:73— pkg/sdk/go/group_memberships.go:73-87 | pkg/sdk/go/groups.go:72-86 | pkg/sdk/go/groups.go:98-112 | pkg/sdk/go/keys.go:70-84 | pkg/sdk/go/org_memberships.go:146-160 | pkg/sdk/go/orgs.go:105-119 | pkg/sdk/go/profiles.go:186-200 | pkg/sdk/go/profiles.go:211-225 | pkg/sdk/go/things.go:239-253 | pkg/sdk/go/things.go:265-279 | pkg/sdk/go/webhooks.go:173-187 — before extracting anything, compare `pkg/sdk/go/group_memberships.go` and `pkg/sdk/go/groups.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/group_memberships.go:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/sdk/go/group_memberships.go:70` calls `Sprintf` and `pkg/sdk/go/org_memberships.go:143` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 4) consumers/writers/postgres/consumer.go:76— consumers/writers/postgres/consumer.go:76-90 | consumers/writers/postgres/consumer.go:121-135 | consumers/writers/timescale/consumer.go:76-90 | consumers/writers/timescale/consumer.go:121-135 — `consumers/writers/postgres/consumer.go` and `consumers/writers/timescale/consumer.go` 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 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/writers/postgres/consumer.go:76` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `consumers/writers/postgres/consumer.go:120` calls `PayloadHash` and `consumers/writers/postgres/consumer.go:75` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 4) readers/postgres/json.go:85— readers/postgres/json.go:85-99 | readers/postgres/senml.go:123-137 | readers/timescale/json.go:162-176 | readers/timescale/senml.go:164-178 — before extracting anything, compare `readers/postgres/json.go` and `readers/postgres/senml.go` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/json.go:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 5) auth/api/logging.go:392— auth/api/logging.go:392-403 | downlinks/api/logging.go:169-180 | readers/api/logging.go:63-74 | things/api/logging.go:468-479 | uiconfigs/api/logging.go:253-264 — before extracting anything, compare `auth/api/logging.go` and `downlinks/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 5) auth/api/logging.go:406— auth/api/logging.go:406-417 | downlinks/api/logging.go:183-194 | readers/api/logging.go:77-88 | things/api/logging.go:482-493 | uiconfigs/api/logging.go:267-278 — before extracting anything, compare `auth/api/logging.go` and `downlinks/api/logging.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 4) auth/postgres/invites.go:49— auth/postgres/invites.go:49-60 | auth/postgres/invites.go:86-97 | auth/postgres/invites.go:546-557 | things/postgres/things.go:302-313 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 4) cmd/alarms/main.go:122— cmd/alarms/main.go:122-133 | cmd/smpp-notifier/main.go:140-151 | cmd/smtp-notifier/main.go:148-159 | cmd/webhooks/main.go:121-132 — `cmd/alarms/main.go` and `cmd/smpp-notifier/main.go` 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 172 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 6) cmd/downlinks/main.go:184— cmd/downlinks/main.go:184-193 | cmd/postgres-reader/main.go:199-208 | cmd/rules/main.go:177-186 | cmd/shadows/main.go:181-190 | cmd/timescale-reader/main.go:174-183 | cmd/uiconfigs/main.go:171-180 — `cmd/downlinks/main.go` and `cmd/postgres-reader/main.go` 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 111 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 6) certs/api/transport.go:34— certs/api/transport.go:34-43 | consumers/notifiers/api/http/transport.go:35-44 | downlinks/api/http/transport.go:38-47 | filestore/api/http/transport.go:92-101 | modbus/api/http/transport.go:43-52 | webhooks/api/http/transport.go:32-41 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `certs/api/transport.go:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 5) auth/api/http/backup/endpoint.go:13— auth/api/http/backup/endpoint.go:13-22 | downlinks/api/http/backup/endpoint.go:19-28 | readers/api/http/backup/endpoint.go:18-27 | things/api/http/backup/endpoint.go:17-26 | uiconfigs/api/http/backup/endpoint.go:21-30 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/endpoint.go:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 5) certs/api/transport.go:35— certs/api/transport.go:35-44 | consumers/notifiers/api/http/transport.go:36-45 | downlinks/api/http/transport.go:39-48 | modbus/api/http/transport.go:44-53 | webhooks/api/http/transport.go:33-42 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `certs/api/transport.go:35` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9–10 lines × 2) pkg/sdk/go/groups.go:180— pkg/sdk/go/groups.go:180-188 | pkg/sdk/go/orgs.go:127-136 — before extracting anything, compare `pkg/sdk/go/groups.go` and `pkg/sdk/go/orgs.go` 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 (9–10 lines × 2) users/api/http/users/transport.go:344— users/api/http/users/transport.go:344-352 | users/api/http/users/transport.go:362-371 — both copies are in the same file, so extract the block into 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 × 7) cmd/alarms/main.go:162— cmd/alarms/main.go:162-170 | REDACTED:204-212 | cmd/postgres-reader/main.go:151-159 | cmd/rules/main.go:156-164 | cmd/smpp-notifier/main.go:180-188 | cmd/smtp-notifier/main.go:188-196 | cmd/timescale-reader/main.go:134-142 — `cmd/alarms/main.go` and `REDACTED` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:202` calls `Go`, `Start` and `cmd/timescale-reader/main.go:133` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 7) pkg/sdk/go/group_memberships.go:72— pkg/sdk/go/group_memberships.go:72-80 | pkg/sdk/go/groups.go:97-105 | pkg/sdk/go/org_memberships.go:145-153 | pkg/sdk/go/profiles.go:210-218 | pkg/sdk/go/things.go:264-272 | pkg/sdk/go/users.go:210-218 | pkg/sdk/go/webhooks.go:172-180 — before extracting anything, compare `pkg/sdk/go/group_memberships.go` and `pkg/sdk/go/groups.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/sdk/go/group_memberships.go:70` calls `Sprintf` and `pkg/sdk/go/org_memberships.go:143` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 5) auth/postgres/invites.go:207— auth/postgres/invites.go:207-214 | auth/postgres/invites.go:494-501 | filestore/postgres/groups.go:64-71 | filestore/postgres/things.go:65-72 | things/postgres/things.go:339-346 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 5) cmd/downlinks/main.go:113— cmd/downlinks/main.go:113-120 | cmd/modbus/main.go:111-118 | cmd/shadows/main.go:108-115 | cmd/uiconfigs/main.go:107-114 | cmd/webhooks/main.go:112-119 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 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 × 6) auth/api/metrics.go:265— auth/api/metrics.go:265-270 | downlinks/api/metrics.go:128-133 | readers/api/metrics.go:54-59 | things/api/metrics.go:323-328 | uiconfigs/api/metrics.go:182-187 | users/api/metrics.go:252-257 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/metrics.go:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 6) auth/postgres/invites.go:49— auth/postgres/invites.go:49-54 | auth/postgres/invites.go:86-91 | auth/postgres/invites.go:546-551 | auth/postgres/memberships.go:183-188 | consumers/alarms/postgres/alarms.go:48-53 | users/postgres/invites.go:50-55 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `consumers/alarms/postgres/alarms.go:56` calls `Wrap` and `auth/postgres/invites.go:56` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) things/api/http/groups/transport.go:165— things/api/http/groups/transport.go:165-172 | things/api/http/profiles/transport.go:196-203 | things/api/http/things/transport.go:288-295 | things/api/http/things/transport.go:542-549 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 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) things/redis/profiles.go:67— things/redis/profiles.go:67-75 | things/redis/things.go:55-63 | things/redis/things.go:139-147 | things/redis/things.go:180-187 — 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 × 3) pkg/sdk/go/groups.go:20— pkg/sdk/go/groups.go:20-31 | pkg/sdk/go/profiles.go:18-29 | pkg/sdk/go/things.go:35-46 — before extracting anything, compare `pkg/sdk/go/groups.go` and `pkg/sdk/go/profiles.go` 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 (12 lines × 3) consumers/notifiers/postgres/init.go:58— consumers/notifiers/postgres/init.go:58-69 | shadows/postgres/init.go:52-63 | webhooks/postgres/init.go:60-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/notifiers/postgres/init.go:58` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 10) auth/api/http/backup/transport.go:23— auth/api/http/backup/transport.go:23-31 | downlinks/api/http/backup/transport.go:28-36 | readers/api/http/backup/transport.go:29-37 | readers/api/http/messages/transport.go:50-58 | things/api/http/backup/transport.go:29-37 | uiconfigs/api/http/backup/transport.go:29-37 | uiconfigs/api/http/groups/transport.go:27-35 | uiconfigs/api/http/orgs/transport.go:28-36 | uiconfigs/api/http/things/transport.go:27-35 | users/api/http/backup/transport.go:28-36 — before extracting anything, compare `auth/api/http/backup/transport.go` and `downlinks/api/http/backup/transport.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/transport.go:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 10) auth/api/http/invites/transport.go:27— auth/api/http/invites/transport.go:27-35 | auth/api/http/keys/transport.go:26-34 | auth/api/http/memberships/transport.go:29-37 | auth/api/http/orgs/transport.go:24-32 | rules/api/http/rules/transport.go:29-37 | rules/api/http/scripts/transport.go:29-37 | things/api/http/groups/transport.go:29-37 | things/api/http/memberships/transport.go:33-41 | things/api/http/profiles/transport.go:29-37 | things/api/http/things/transport.go:33-41 — `auth/api/http/invites/transport.go` and `auth/api/http/memberships/transport.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/invites/transport.go:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 11) cmd/alarms/main.go:144— cmd/alarms/main.go:144-152 | REDACTED:167-175 | cmd/downlinks/main.go:134-142 | cmd/filestore/main.go:163-171 | cmd/modbus/main.go:132-140 | cmd/shadows/main.go:129-137 | cmd/smpp-notifier/main.go:162-170 | cmd/smtp-notifier/main.go:170-178 | cmd/uiconfigs/main.go:128-136 | cmd/users/main.go:189-197 | cmd/webhooks/main.go:143-151 — `cmd/alarms/main.go` and `REDACTED` 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 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/uiconfigs/main.go:138` calls `connectToDB`, `Close` and `cmd/users/main.go:199` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 11) cmd/alarms/main.go:139— cmd/alarms/main.go:139-147 | cmd/converters/main.go:100-108 | cmd/downlinks/main.go:129-137 | cmd/modbus/main.go:127-135 | cmd/postgres-reader/main.go:122-130 | cmd/rules/main.go:133-141 | cmd/shadows/main.go:124-132 | cmd/smpp-notifier/main.go:157-165 | cmd/smtp-notifier/main.go:165-173 | cmd/uiconfigs/main.go:123-131 | cmd/webhooks/main.go:138-146 — `cmd/alarms/main.go` and `cmd/converters/main.go` 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 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Outbound HTTP without resilience cmd/mqtt/main.go:413— `http.Get(` 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 REDACTED:520— `http.Client{` 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.
AXR1 · Runtime accessibility (rendered)· WCAG 1.4.3 reproducibly failed in a rendered surface · ×1
WCAG 1.4.3 reproducibly failed in a rendered surface — axe-core rule(s) color-contrast failed on: #rc-tabs-0-tab-searchForm, .ant-form-item.css-#:nth-child(1) > .ant-form-item-row.ant-row.css-# > .ant-form-item-label.ant-col.css-# > label[title=""] > span > .SearchForm--labelCount, .ant-form-item.css-#:nth-child(2) > .ant-form-item-row.ant-row.css-# > .ant-form-item-label.ant-col.css-# > label[title=""] > span > .SearchForm--labelCount, a[href$="search"], a[routerlink="/auth/register/"] > .mfx-link__label[_ngcontent-ng-#=""]. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
AXR1 · Runtime accessibility (rendered)· WCAG 2.4.2 reproducibly failed in a rendered surface · ×1
WCAG 2.4.2 reproducibly failed in a rendered surface — axe-core rule(s) document-title failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
AXR1 · Runtime accessibility (rendered)· WCAG 3.1.1 reproducibly failed in a rendered surface · ×1
WCAG 3.1.1 reproducibly failed in a rendered surface — axe-core rule(s) html-has-lang, html-lang-valid failed on: html. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
AXR1 · Runtime accessibility (rendered)· WCAG 4.1.2 reproducibly failed in a rendered surface · ×1
WCAG 4.1.2 reproducibly failed in a rendered surface — axe-core rule(s) aria-allowed-attr, aria-command-name, aria-conditional-attr, aria-deprecated-role, aria-hidden-body, aria-hidden-focus, aria-prohibited-attr, aria-required-attr, aria-roles, aria-valid-attr, aria-valid-attr-value, button-name, duplicate-id-aria, label, link-name, nested-interactive failed on: #rc_select_0, #rc_select_1, #rc_select_2. Runtime evidence (advisory — not scored); fix and re-scan to verify it clears.
converters.toSenMLEntries (cyclomatic 26) converters/service.go:310— converters.toSenMLEntries has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: converters/service.go holds 4 of the 14 functions over the threshold — including the worst — and 29 of the 64 points over it (45%), 3.2× the next-largest file (readers/api/http/messages/converters.go at 9). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
converters.parseJSONRecord (cyclomatic 26) converters/service.go:390— converters.parseJSONRecord has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs 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. This file is where this pass's cyclomatic complexity CONCENTRATES: converters/service.go holds 4 of the 14 functions over the threshold — including the worst — and 29 of the 64 points over it (45%), 3.2× the next-largest file (readers/api/http/messages/converters.go at 9). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
messages.ConvertCSVToSenMLMessages (cyclomatic 24) readers/api/http/messages/converters.go:321— messages.ConvertCSVToSenMLMessages 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.
adapterService.PublishSenMLMessagesFromCSV (cyclomatic 20) converters/service.go:65— adapterService.PublishSenMLMessagesFromCSV has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: converters/service.go holds 4 of the 14 functions over the threshold — including the worst — and 29 of the 64 points over it (45%), 3.2× the next-largest file (readers/api/http/messages/converters.go at 9). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
thingsService.CreateGroupMemberships (cyclomatic 20) REDACTED:67— thingsService.CreateGroupMemberships 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.
usersService.handleIdentity (cyclomatic 20) users/service.go:646— usersService.handleIdentity 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.
http.parseCSVFields (cyclomatic 19) modbus/api/http/csv.go:28— http.parseCSVFields has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
email.IsEmail (cyclomatic 19) pkg/email/email.go:124— email.IsEmail has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mqtt.validateCustomTopic (cyclomatic 18) mqtt/handler.go:447— mqtt.validateCustomTopic 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.
adapterService.PublishJSONMessagesFromCSV (cyclomatic 17) converters/service.go:136— adapterService.PublishJSONMessagesFromCSV has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This file is where this pass's cyclomatic complexity CONCENTRATES: converters/service.go holds 4 of the 14 functions over the threshold — including the worst — and 29 of the 64 points over it (45%), 3.2× the next-largest file (readers/api/http/messages/converters.go at 9). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
SenMLPageMetadata.query (cyclomatic 17) pkg/sdk/go/messages.go:406— SenMLPageMetadata.query 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.
http.parseFileName (cyclomatic 16) filestore/api/http/transport.go:715— http.parseFileName has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
groupsRepository.RetrieveByGroup (cyclomatic 16) filestore/postgres/groups.go:131— groupsRepository.RetrieveByGroup 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.
modbus.encodeNumericField (cyclomatic 16) modbus/codec.go:87— modbus.encodeNumericField 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.
Deprecated module: github.com/golang/protobuf — `github.com/golang/protobuf` is required at v1.5.4 in REDACTED, and its author has DEPRECATED the module: "Use the "google.golang.org/protobuf" module instead." A deprecation is declared by the author in the module's own REDACTED and applies to the whole module, not to one release, so moving to a newer version of it does not clear this. Follow the replacement the notice names.
converters.parseJSONRecord (cognitive 59) converters/service.go:390— converters.parseJSONRecord has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (50 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 36). Of this number, 58 points are the body's own statements and 1 belongs 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. This file is where this pass's cognitive complexity CONCENTRATES: converters/service.go holds 5 of the 43 functions over the threshold — including the worst — and 118 of the 364 points over it (32%), 2.4× the next-largest file (readers/api/http/messages/converters.go at 49). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
converters.toSenMLEntries (cognitive 45) converters/service.go:310— converters.toSenMLEntries has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: converters/service.go holds 5 of the 43 functions over the threshold — including the worst — and 118 of the 364 points over it (32%), 2.4× the next-largest file (readers/api/http/messages/converters.go at 49). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
adapterService.PublishSenMLMessagesFromCSV (cognitive 38) converters/service.go:65— adapterService.PublishSenMLMessagesFromCSV has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 3 (5 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). Of this number, 36 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: converters/service.go holds 5 of the 43 functions over the threshold — including the worst — and 118 of the 364 points over it (32%), 2.4× the next-largest file (readers/api/http/messages/converters.go at 49). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
usersService.handleIdentity (cognitive 35) users/service.go:646— usersService.handleIdentity has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
adapterService.PublishJSONMessagesFromCSV (cognitive 34) converters/service.go:136— adapterService.PublishJSONMessagesFromCSV has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (26 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This file is where this pass's cognitive complexity CONCENTRATES: converters/service.go holds 5 of the 43 functions over the threshold — including the worst — and 118 of the 364 points over it (32%), 2.4× the next-largest file (readers/api/http/messages/converters.go at 49). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
http.parseCSVFields (cognitive 34) modbus/api/http/csv.go:28— http.parseCSVFields has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (28 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 17). Of this number, 32 points are the body's own statements and 2 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.
messages.ConvertCSVToSenMLMessages (cognitive 34) readers/api/http/messages/converters.go:321— messages.ConvertCSVToSenMLMessages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thingsService.CreateGroupMemberships (cognitive 34) REDACTED:67— thingsService.CreateGroupMemberships has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 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.
cli.profilesFromFile (cognitive 30) REDACTED:290— cli.profilesFromFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.benchProvision (cognitive 28) REDACTED:185— cli.benchProvision has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.thingsFromFile (cognitive 27) REDACTED:223— cli.thingsFromFile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (6 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
messages.ConvertSenMLToJSONFile (cognitive 25) readers/api/http/messages/converters.go:236— messages.ConvertSenMLToJSONFile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
subEventStore.Subscribe (cognitive 24) pkg/events/subscriber.go:93— subEventStore.Subscribe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thingsService.CreateGroups (cognitive 24) things/groups.go:121— thingsService.CreateGroups has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
payload.UnmarshalXML (cognitive 23) downlinks/payload.go:63— payload.UnmarshalXML has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
messages.ConvertCSVToJSONMessages (cognitive 23) readers/api/http/messages/converters.go:389— messages.ConvertCSVToJSONMessages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rules.validateConditions (cognitive 23) rules/api/http/rules/requests.go:252— rules.validateConditions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
messages.ConvertJSONToCSVFile (cognitive 22) readers/api/http/messages/converters.go:79— messages.ConvertJSONToCSVFile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
orgRepository.Remove (cognitive 21) auth/postgres/orgs.go:99— orgRepository.Remove has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (9 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.benchRun (cognitive 21) REDACTED:307— cli.benchRun has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 11). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 349, 328). 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.
email.IsEmail (cognitive 21) pkg/email/email.go:124— email.IsEmail has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, 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.
postgres.toProfile (cognitive 21) things/postgres/profiles.go:376— postgres.toProfile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (21 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
messages.Flatten (cognitive 20) readers/api/http/messages/converters.go:182— messages.Flatten has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (12 pts), match/switch 2 (6 pts), if/else 1 (2 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
service.CreateOrgInvite (cognitive 19) auth/invites.go:132— service.CreateOrgInvite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
mqtt.validateCustomTopic (cognitive 19) mqtt/handler.go:447— mqtt.validateCustomTopic has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rulesService.ConsumeAlarm (cognitive 19) rules/service.go:479— rulesService.ConsumeAlarm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
groupCache.RemoveGroupEntities (cognitive 19) things/redis/groups.go:32— groupCache.RemoveGroupEntities has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (8 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thingsService.UpdateGroupMemberships (cognitive 19) REDACTED:256— thingsService.UpdateGroupMemberships has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
groupsRepository.RetrieveByGroup (cognitive 18) filestore/postgres/groups.go:131— groupsRepository.RetrieveByGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
shadows.equalState (cognitive 18) shadows/shadows.go:42— shadows.equalState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
adapterService.PublishSenMLMessagesFromJSON (cognitive 17) converters/service.go:213— adapterService.PublishSenMLMessagesFromJSON has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 15 points are the body's own statements and 2 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. This file is where this pass's cognitive complexity CONCENTRATES: converters/service.go holds 5 of the 43 functions over the threshold — including the worst — and 118 of the 364 points over it (32%), 2.4× the next-largest file (readers/api/http/messages/converters.go at 49). No single row can show this, because each is measured only against the threshold: reducing this one file moves this dimension further than any other file in the repository.
thingsRepository.RetrieveByThing (cognitive 17) filestore/postgres/things.go:132— thingsRepository.RetrieveByThing has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
http.SendRequest (cognitive 17) pkg/clients/http/http.go:30— http.SendRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
createProfilesReq.validate (cognitive 17) things/api/http/profiles/requests.go:32— createProfilesReq.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
invitesRepository.SaveOrgInvite (cognitive 16) auth/postgres/invites.go:30— invitesRepository.SaveOrgInvite has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
modbus.encodeNumericField (cognitive 16) modbus/codec.go:87— modbus.encodeNumericField has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SenMLPageMetadata.query (cognitive 16) pkg/sdk/go/messages.go:406— SenMLPageMetadata.query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 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.
json.transformTimeField (cognitive 16) pkg/transformers/json/transformer.go:83— json.transformTimeField has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
jsonRepository.Restore (cognitive 16) readers/timescale/json.go:75— jsonRepository.Restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ruleRepository.Save (cognitive 16) rules/postgres/rules.go:32— ruleRepository.Save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (4 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
thingsService.CanUserAccessThings (cognitive 16) things/service.go:638— thingsService.CanUserAccessThings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usersService.RegisterAdmin (cognitive 16) users/service.go:385— usersService.RegisterAdmin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
usersService.changeStatus (cognitive 16) users/service.go:1082— usersService.changeStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· `Service.RemoveObserver` takes no context.Context; its 5 sibling operations take one · ×1
`Service.RemoveObserver` takes no context.Context; its 5 sibling operations take one coap/adapter.go:36— 5 of 6 fallible operations of `Service` take a `ctx context.Context` (5 of 6). Siblings: Service.Publish (coap/adapter.go:25); Service.Subscribe (coap/adapter.go:29); Service.Unsubscribe (coap/adapter.go:32); Service.SendCommandToThing (coap/adapter.go:39); Service.SendCommandToGroup (coap/adapter.go:42). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency· `messages.Flatten` returns a map (`map[K]V`) where its 8 siblings return a slice (`[]T`) · ×1
`messages.Flatten` returns a map (`map[K]V`) where its 8 siblings return a slice (`[]T`) readers/api/http/messages/converters.go:182— 8 of 9 collection-returning members of `package messages` return a slice (`[]T`) (8 of 9). Siblings: messages.ConvertSenMLToCSVFile (readers/api/http/messages/converters.go:40); messages.ConvertJSONToCSVFile (readers/api/http/messages/converters.go:79); messages.ConvertJSONToJSONFile (readers/api/http/messages/converters.go:215); messages.ConvertSenMLToJSONFile (readers/api/http/messages/converters.go:236); messages.ConvertJSONToJSONMessages (readers/api/http/messages/converters.go:281). Return a slice (`[]T`). [rule A4]
D22 · Internal API Consistency· `Service.OAuthLogin` takes no context.Context; its 25 sibling operations take one · ×1
`Service.OAuthLogin` takes no context.Context; its 25 sibling operations take one users/service.go:106— 25 of 26 fallible operations of `Service` take a `ctx context.Context` (25 of 26). Siblings: Service.SelfRegister (users/service.go:73); Service.VerifyEmail (users/service.go:79); Service.RegisterByInvite (users/service.go:85); Service.Register (users/service.go:90); Service.RegisterAdmin (users/service.go:94). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D4 · Code Duplication· Near-duplicate member family (11 members, 24 shared lines) · ×1
Near-duplicate member family (11 members, 24 shared lines) cmd/alarms/main.go:181— cmd/alarms/main.go:181-243 | cmd/converters/main.go:148-194 | cmd/downlinks/main.go:181-243 | cmd/modbus/main.go:179-241 | cmd/mqtt/main.go:260-338 | cmd/postgres-reader/main.go:170-238 | cmd/rules/main.go:174-236 | cmd/shadows/main.go:178-240 | cmd/timescale-reader/main.go:153-212 | cmd/uiconfigs/main.go:168-229 | cmd/webhooks/main.go:180-242 — These 11 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 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 (8 members, 25 shared lines) · ×1
Near-duplicate member family (8 members, 25 shared lines) consumers/notifiers/postgres/notifiers.go:146— consumers/notifiers/postgres/notifiers.go:146-179 | downlinks/postgres/downlinks.go:243-278 | filestore/postgres/groups.go:54-86 | filestore/postgres/things.go:55-87 | modbus/postgres/clients.go:267-302 | rules/postgres/rules.go:195-227 | things/postgres/things.go:389-449 | webhooks/postgres/webhooks.go:149-182 — These 8 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 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, 23 shared lines) · ×1
Near-duplicate member family (7 members, 23 shared lines) cmd/alarms/main.go:181— cmd/alarms/main.go:181-243 | REDACTED:223-299 | cmd/filestore/main.go:196-286 | cmd/modbus/main.go:179-241 | cmd/smpp-notifier/main.go:200-293 | cmd/smtp-notifier/main.go:208-290 | cmd/webhooks/main.go:180-242 — 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 (6 members, 21 shared lines) · ×1
Near-duplicate member family (6 members, 21 shared lines) cmd/alarms/main.go:181— cmd/alarms/main.go:181-243 | REDACTED:223-299 | cmd/filestore/main.go:196-286 | cmd/modbus/main.go:179-241 | cmd/postgres-reader/main.go:170-238 | cmd/webhooks/main.go:180-242 — These 6 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 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 pair (44 shared lines) modbus/postgres/clients.go:108— modbus/postgres/clients.go:108-156 | modbus/postgres/clients.go:158-206 — 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 (29 shared lines) cmd/auth/main.go:382— cmd/auth/main.go:382-445 | cmd/things/main.go:412-480 — These two members are variants of one another: 29 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) consumers/alarms/postgres/alarms.go:104— consumers/alarms/postgres/alarms.go:104-133 | consumers/alarms/postgres/alarms.go:135-164 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (288 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (288 members, 50+ identical tokens) audit/api/logging.go:30— audit/api/logging.go:30-41 | audit/api/logging.go:43-55 | audit/api/logging.go:57-69 | audit/api/logging.go:71-83 | auth/api/logging.go:30-42 | auth/api/logging.go:44-56 | auth/api/logging.go:58-70 | auth/api/logging.go:72-83 | auth/api/logging.go:85-96 | auth/api/logging.go:98-114 | auth/api/logging.go:116-128 | auth/api/logging.go:130-142 | auth/api/logging.go:144-156 | auth/api/logging.go:158-169 | auth/api/logging.go:171-182 | auth/api/logging.go:184-194 | auth/api/logging.go:196-208 | auth/api/logging.go:210-222 | auth/api/logging.go:224-236 | auth/api/logging.go:238-250 | auth/api/logging.go:252-264 | auth/api/logging.go:266-277 | auth/api/logging.go:279-291 | auth/api/logging.go:293-305 | auth/api/logging.go:307-319 | auth/api/logging.go:321-333 | auth/api/logging.go:335-347 | auth/api/logging.go:349-361 | auth/api/logging.go:363-375 | auth/api/logging.go:377-389 | auth/api/logging.go:391-403 | auth/api/logging.go:405-417 | auth/api/logging.go:419-430 | auth/api/logging.go:432-443 | auth/api/logging.go:445-457 | auth/api/logging.go:459-471 | auth/api/logging.go:473-486 | auth/api/logging.go:488-503 | auth/api/logging.go:505-518 | auth/api/logging.go:520-533 | auth/api/logging.go:535-548 | auth/api/logging.go:550-563 | auth/api/logging.go:565-577 | auth/api/logging.go:579-592 | auth/api/logging.go:594-605 | auth/api/logging.go:607-621 | certs/api/logging.go:31-43 | certs/api/logging.go:45-57 | certs/api/logging.go:59-71 | certs/api/logging.go:73-85 | certs/api/logging.go:87-99 | certs/api/logging.go:101-113 | certs/api/logging.go:115-126 | certs/api/logging.go:128-140 | certs/api/logging.go:142-153 | coap/api/logging.go:31-46 | coap/api/logging.go:48-59 | coap/api/logging.go:61-72 | coap/api/logging.go:74-85 | coap/api/logging.go:87-99 | coap/api/logging.go:101-113 | consumers/alarms/api/logging.go:26-38 | consumers/alarms/api/logging.go:40-52 | consumers/alarms/api/logging.go:54-66 | consumers/alarms/api/logging.go:68-80 | consumers/alarms/api/logging.go:82-94 | consumers/alarms/api/logging.go:96-108 | consumers/alarms/api/logging.go:110-121 | consumers/alarms/api/logging.go:123-134 | consumers/alarms/api/logging.go:136-148 | consumers/alarms/api/logging.go:150-161 | consumers/notifiers/api/logging.go:32-44 | consumers/notifiers/api/logging.go:46-58 | consumers/notifiers/api/logging.go:60-72 | consumers/notifiers/api/logging.go:74-86 | consumers/notifiers/api/logging.go:88-100 | consumers/notifiers/api/logging.go:102-113 | consumers/notifiers/api/logging.go:115-126 | consumers/writers/api/logging.go:32-43 | converters/api/logging.go:30-42 | converters/api/logging.go:44-56 | converters/api/logging.go:58-70 | converters/api/logging.go:72-84 | downlinks/api/logging.go:32-44 | downlinks/api/logging.go:46-58 | downlinks/api/logging.go:60-72 | downlinks/api/logging.go:74-86 | downlinks/api/logging.go:88-100 | downlinks/api/logging.go:102-114 | downlinks/api/logging.go:116-127 | downlinks/api/logging.go:129-140 | downlinks/api/logging.go:142-153 | downlinks/api/logging.go:155-166 | downlinks/api/logging.go:168-180 | downlinks/api/logging.go:182-194 | filestore/api/logging.go:32-43 | filestore/api/logging.go:45-56 | filestore/api/logging.go:58-69 | filestore/api/logging.go:71-82 | filestore/api/logging.go:84-95 | filestore/api/logging.go:97-108 | filestore/api/logging.go:110-122 | filestore/api/logging.go:124-136 | filestore/api/logging.go:138-150 | filestore/api/logging.go:152-164 | filestore/api/logging.go:166-178 | filestore/api/logging.go:180-191 | filestore/api/logging.go:193-204 | http/api/logging.go:32-43 | http/api/logging.go:45-57 | http/api/logging.go:59-71 | http/api/logging.go:73-84 | http/api/logging.go:86-97 | modbus/api/logging.go:29-41 | modbus/api/logging.go:43-55 | modbus/api/logging.go:57-69 | modbus/api/logging.go:71-83 | modbus/api/logging.go:85-97 | modbus/api/logging.go:99-111 | modbus/api/logging.go:113-125 | modbus/api/logging.go:127-139 | modbus/api/logging.go:141-153 | modbus/api/logging.go:155-166 | modbus/api/logging.go:168-179 | modbus/api/logging.go:181-192 | modbus/api/logging.go:194-205 | mqtt/api/logging.go:31-43 | mqtt/api/logging.go:45-57 | mqtt/api/logging.go:59-71 | mqtt/api/logging.go:73-85 | mqtt/api/logging.go:87-99 | readers/api/logging.go:34-46 | readers/api/logging.go:48-60 | readers/api/logging.go:62-74 | readers/api/logging.go:76-88 | readers/api/logging.go:90-102 | readers/api/logging.go:104-116 | readers/api/logging.go:118-130 | readers/api/logging.go:132-144 | readers/api/logging.go:146-158 | readers/api/logging.go:160-172 | readers/api/logging.go:174-185 | rules/api/logging.go:27-39 | rules/api/logging.go:41-53 | rules/api/logging.go:55-67 | rules/api/logging.go:69-81 | rules/api/logging.go:83-95 | rules/api/logging.go:97-109 | rules/api/logging.go:111-123 | rules/api/logging.go:125-137 | rules/api/logging.go:139-151 | rules/api/logging.go:153-164 | rules/api/logging.go:166-177 | rules/api/logging.go:179-190 | rules/api/logging.go:192-203 | rules/api/logging.go:205-217 | rules/api/logging.go:219-231 | rules/api/logging.go:233-245 | rules/api/logging.go:247-259 | rules/api/logging.go:261-273 | rules/api/logging.go:275-286 | rules/api/logging.go:288-301 | rules/api/logging.go:303-316 | rules/api/logging.go:318-331 | shadows/api/logging.go:32-44 | shadows/api/logging.go:46-58 | shadows/api/logging.go:60-72 | shadows/api/logging.go:74-85 | shadows/api/logging.go:87-98 | things/api/logging.go:31-43 | things/api/logging.go:45-57 | things/api/logging.go:59-75 | things/api/logging.go:77-89 | things/api/logging.go:91-103 | things/api/logging.go:105-116 | things/api/logging.go:118-130 | things/api/logging.go:132-144 | things/api/logging.go:146-158 | things/api/logging.go:160-172 | things/api/logging.go:174-186 | things/api/logging.go:188-200 | things/api/logging.go:202-214 | things/api/logging.go:216-228 | things/api/logging.go:230-242 | things/api/logging.go:244-256 | things/api/logging.go:258-270 | things/api/logging.go:272-283 | things/api/logging.go:285-295 | things/api/logging.go:297-308 | things/api/logging.go:310-321 | things/api/logging.go:323-334 | things/api/logging.go:336-347 | things/api/logging.go:349-360 | things/api/logging.go:362-373 | things/api/logging.go:375-386 | things/api/logging.go:388-399 | things/api/logging.go:401-412 | things/api/logging.go:414-425 | things/api/logging.go:427-438 | things/api/logging.go:440-451 | things/api/logging.go:453-465 | things/api/logging.go:467-479 | things/api/logging.go:481-493 | things/api/logging.go:495-507 | things/api/logging.go:509-521 | things/api/logging.go:523-535 | things/api/logging.go:537-548 | things/api/logging.go:550-562 | things/api/logging.go:564-576 | things/api/logging.go:578-590 | things/api/logging.go:592-604 | things/api/logging.go:606-618 | things/api/logging.go:620-631 | things/api/logging.go:633-645 | things/api/logging.go:647-659 | things/api/logging.go:661-673 | things/api/logging.go:675-686 | things/api/logging.go:688-700 | things/api/logging.go:702-714 | things/api/logging.go:716-728 | things/api/logging.go:730-742 | things/api/logging.go:744-756 | things/api/logging.go:758-770 | things/api/logging.go:772-783 | things/api/logging.go:785-796 | things/api/logging.go:798-809 | uiconfigs/api/logging.go:32-44 | uiconfigs/api/logging.go:46-58 | uiconfigs/api/logging.go:60-72 | uiconfigs/api/logging.go:74-85 | uiconfigs/api/logging.go:87-99 | uiconfigs/api/logging.go:101-113 | uiconfigs/api/logging.go:115-127 | uiconfigs/api/logging.go:129-141 | uiconfigs/api/logging.go:143-154 | uiconfigs/api/logging.go:156-167 | uiconfigs/api/logging.go:169-181 | uiconfigs/api/logging.go:183-195 | uiconfigs/api/logging.go:197-209 | uiconfigs/api/logging.go:211-223 | uiconfigs/api/logging.go:225-236 | uiconfigs/api/logging.go:238-250 | uiconfigs/api/logging.go:252-264 | uiconfigs/api/logging.go:266-278 | users/api/logging.go:31-43 | users/api/logging.go:45-57 | users/api/logging.go:59-71 | users/api/logging.go:73-85 | users/api/logging.go:87-100 | users/api/logging.go:102-113 | users/api/logging.go:115-127 | users/api/logging.go:129-140 | users/api/logging.go:142-153 | users/api/logging.go:155-167 | users/api/logging.go:169-181 | users/api/logging.go:183-195 | users/api/logging.go:197-208 | users/api/logging.go:210-221 | users/api/logging.go:223-235 | users/api/logging.go:237-248 | users/api/logging.go:250-262 | users/api/logging.go:264-275 | users/api/logging.go:277-289 | users/api/logging.go:291-303 | users/api/logging.go:305-317 | users/api/logging.go:319-331 | users/api/logging.go:391-404 | users/api/logging.go:406-419 | users/api/logging.go:421-433 | users/api/logging.go:435-448 | users/api/logging.go:450-462 | users/api/logging.go:464-476 | webhooks/api/logging.go:33-45 | webhooks/api/logging.go:47-59 | webhooks/api/logging.go:61-73 | webhooks/api/logging.go:75-87 | webhooks/api/logging.go:89-101 | webhooks/api/logging.go:103-115 | webhooks/api/logging.go:117-128 | webhooks/api/logging.go:130-141 | webhooks/api/logging.go:143-154 | ws/api/logging.go:32-47 | ws/api/logging.go:49-60 | ws/api/logging.go:62-73 | ws/api/logging.go:75-87 | ws/api/logging.go:89-100 | ws/api/logging.go:102-114 | ws/api/logging.go:116-127 — These 288 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 288 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 288 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) audit/api/http/transport.go:171— audit/api/http/transport.go:171-187 | auth/api/http/backup/transport.go:73-89 | auth/api/http/invites/transport.go:204-220 | auth/api/http/keys/transport.go:116-132 | auth/api/http/memberships/transport.go:179-195 | auth/api/http/orgs/transport.go:239-255 | auth/api/http/sessions/transport.go:49-65 | certs/api/transport.go:116-132 | consumers/alarms/api/http/transport.go:278-294 | consumers/notifiers/api/http/transport.go:253-269 | downlinks/api/http/backup/transport.go:87-103 | downlinks/api/http/transport.go:229-245 | filestore/api/http/transport.go:419-435 | modbus/api/http/transport.go:372-388 | mqtt/api/http/transport.go:81-97 | readers/api/http/backup/transport.go:81-97 | readers/api/http/messages/transport.go:474-490 | rules/api/http/rules/transport.go:262-278 | rules/api/http/scripts/transport.go:221-237 | shadows/api/http/transport.go:97-113 | things/api/http/backup/transport.go:78-94 | things/api/http/groups/transport.go:335-351 | things/api/http/memberships/transport.go:168-184 | things/api/http/profiles/transport.go:368-384 | things/api/http/things/transport.go:551-567 | uiconfigs/api/http/backup/transport.go:88-104 | uiconfigs/api/http/groups/transport.go:106-122 | uiconfigs/api/http/orgs/transport.go:107-123 | uiconfigs/api/http/things/transport.go:106-122 | webhooks/api/http/transport.go:298-314 — 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 (24 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (24 members, 50+ identical tokens) cmd/alarms/main.go:112— cmd/alarms/main.go:112-179 | cmd/audit/main.go:106-166 | cmd/auth/main.go:154-229 | REDACTED:137-221 | cmd/coap/main.go:79-141 | cmd/converters/main.go:70-146 | cmd/downlinks/main.go:112-179 | cmd/filestore/main.go:132-194 | cmd/http/main.go:63-124 | cmd/modbus/main.go:110-177 | cmd/mqtt/main.go:144-258 | cmd/postgres-reader/main.go:105-168 | cmd/postgres-writer/main.go:66-109 | cmd/rules/main.go:104-172 | cmd/shadows/main.go:107-176 | cmd/smpp-notifier/main.go:130-198 | cmd/smtp-notifier/main.go:138-206 | cmd/things/main.go:155-246 | cmd/timescale-reader/main.go:96-151 | cmd/timescale-writer/main.go:65-107 | cmd/uiconfigs/main.go:106-166 | cmd/users/main.go:170-220 | cmd/webhooks/main.go:111-178 | REDACTED:63-107 — These 24 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 24 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 24 times.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) audit/postgres/init.go:27— audit/postgres/init.go:27-39 | auth/postgres/init.go:30-42 | certs/postgres/init.go:39-56 | consumers/alarms/postgres/init.go:29-42 | consumers/notifiers/postgres/init.go:29-41 | consumers/writers/postgres/init.go:31-44 | consumers/writers/timescale/init.go:31-44 | downlinks/postgres/init.go:28-40 | filestore/postgres/init.go:28-41 | modbus/postgres/init.go:29-43 | mqtt/postgres/init.go:28-41 | shadows/postgres/init.go:24-36 | things/postgres/init.go:31-44 | uiconfigs/postgres/init.go:28-41 | users/postgres/init.go:32-44 | webhooks/postgres/init.go:29-41 — These 16 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 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· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) audit/postgres/init.go:41— audit/postgres/init.go:41-90 | auth/postgres/init.go:44-198 | certs/postgres/init.go:58-118 | consumers/alarms/postgres/init.go:44-100 | consumers/writers/postgres/init.go:46-154 | consumers/writers/timescale/init.go:46-122 | downlinks/postgres/init.go:42-130 | filestore/postgres/init.go:43-115 | modbus/postgres/init.go:45-86 | mqtt/postgres/init.go:43-99 | rules/postgres/init.go:45-200 | things/postgres/init.go:46-219 | uiconfigs/postgres/init.go:43-97 | users/postgres/init.go:46-134 — 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.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) consumers/notifiers/postgres/notifiers.go:31— consumers/notifiers/postgres/notifiers.go:31-67 | rules/postgres/rules.go:32-73 | things/postgres/groups.go:33-73 | things/postgres/things.go:36-74 | uiconfigs/postgres/groups.go:30-65 | uiconfigs/postgres/orgs.go:30-65 | uiconfigs/postgres/things.go:30-65 — 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.
D4 · Code Duplication· Edited copy of a member (89 corresponding lines) · ×1
Edited copy of a member (89 corresponding lines) filestore/postgres/groups.go:131— filestore/postgres/groups.go:131-222 | filestore/postgres/things.go:132-220 — These two members are one piece of code written twice and then edited apart: 89 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 (96 corresponding lines) · ×1
Edited copy of a member (96 corresponding lines) auth/api/grpc/server.go:47— auth/api/grpc/server.go:47-145 | things/api/grpc/server.go:47-142 — These two members are one piece of code written twice and then edited apart: 96 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 (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) auth/postgres/invites.go:294— auth/postgres/invites.go:294-360 | auth/postgres/invites.go:362-442 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 109+ corresponding lines) · ×1
Edited copies of one member (3 members, 109+ corresponding lines) cli/org_memberships.go:10— cli/org_memberships.go:10-118 | cli/profiles.go:13-140 | cli/webhooks.go:10-118 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 109 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (92 corresponding lines) · ×1
Edited copy of a member (92 corresponding lines) cli/group_memberships.go:10— cli/group_memberships.go:10-101 | cli/orgs.go:10-121 — These two members are one piece of code written twice and then edited apart: 92 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 (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) pkg/sdk/go/messages.go:346— pkg/sdk/go/messages.go:346-404 | pkg/sdk/go/messages.go:406-475 — These two members are one piece of code written twice and then edited apart: 59 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) things/api/http/backup/endpoint.go:49— things/api/http/backup/endpoint.go:49-106 | things/api/http/backup/endpoint.go:108-157 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 41+ corresponding lines) · ×1
Edited copies of one member (3 members, 41+ corresponding lines) uiconfigs/postgres/groups.go:88— uiconfigs/postgres/groups.go:88-128 | uiconfigs/postgres/orgs.go:88-128 | uiconfigs/postgres/things.go:88-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 41 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×1
Edited copy of a member (45 corresponding lines) downlinks/api/http/backup/endpoint.go:52— downlinks/api/http/backup/endpoint.go:52-100 | downlinks/api/http/backup/endpoint.go:102-146 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 36+ corresponding lines) · ×1
Edited copies of one member (5 members, 36+ corresponding lines) downlinks/postgres/downlinks.go:32— downlinks/postgres/downlinks.go:32-71 | rules/postgres/scripts.go:17-52 | rules/postgres/scripts.go:201-241 | things/postgres/profiles.go:36-71 | webhooks/postgres/webhooks.go:31-67 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 40+ corresponding lines) · ×1
Edited copies of one member (5 members, 40+ corresponding lines) auth/postgres/key.go:87— auth/postgres/key.go:87-133 | auth/postgres/memberships.go:34-75 | mqtt/postgres/subscriptions.go:49-88 | rules/postgres/scripts.go:80-134 | things/postgres/memberships.go:78-120 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 40 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 34+ corresponding lines) · ×1
Edited copies of one member (4 members, 34+ corresponding lines) pkg/sdk/go/groups.go:33— pkg/sdk/go/groups.go:33-67 | pkg/sdk/go/profiles.go:31-64 | pkg/sdk/go/things.go:48-82 | pkg/sdk/go/webhooks.go:15-48 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 34 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 42+ corresponding lines) · ×1
Edited copies of one member (3 members, 42+ corresponding lines) things/api/http/groups/endpoint.go:15— things/api/http/groups/endpoint.go:15-56 | things/api/http/profiles/endpoint.go:15-57 | things/api/http/things/endpoint.go:15-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 45+ corresponding lines) · ×1
Edited copies of one member (3 members, 45+ corresponding lines) audit/api/http/transport.go:120— audit/api/http/transport.go:120-169 | consumers/alarms/api/http/transport.go:122-172 | rules/api/runs.go:26-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 45 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) auth/api/http/memberships/transport.go:89— auth/api/http/memberships/transport.go:89-131 | certs/api/transport.go:134-185 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 36+ corresponding lines) · ×1
Edited copies of one member (3 members, 36+ corresponding lines) uiconfigs/postgres/groups.go:130— uiconfigs/postgres/groups.go:130-165 | uiconfigs/postgres/orgs.go:130-165 | uiconfigs/postgres/things.go:130-165 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 25+ corresponding lines) · ×1
Edited copies of one member (7 members, 25+ corresponding lines) things/postgres/groups.go:236— things/postgres/groups.go:236-262 | things/postgres/profiles.go:146-174 | things/postgres/profiles.go:233-266 | things/postgres/things.go:155-184 | things/postgres/things.go:208-232 | webhooks/postgres/webhooks.go:69-99 | webhooks/postgres/webhooks.go:101-131 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 60+ corresponding lines) · ×1
Edited copies of one member (7 members, 60+ corresponding lines) cmd/alarms/main.go:48— cmd/alarms/main.go:48-110 | cmd/downlinks/main.go:48-110 | cmd/modbus/main.go:46-108 | cmd/rules/main.go:40-102 | cmd/shadows/main.go:43-105 | cmd/uiconfigs/main.go:45-104 | cmd/webhooks/main.go:47-109 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 60 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) pkg/sdk/go/certs.go:43— pkg/sdk/go/certs.go:43-79 | pkg/sdk/go/certs.go:81-108 | pkg/sdk/go/certs.go:136-164 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 35+ corresponding lines) · ×1
Edited copies of one member (3 members, 35+ corresponding lines) readers/api/http/messages/transport.go:274— readers/api/http/messages/transport.go:274-308 | readers/api/http/messages/transport.go:310-347 | readers/api/http/messages/transport.go:373-410 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) pkg/sdk/go/orgs.go:21— pkg/sdk/go/orgs.go:21-46 | pkg/sdk/go/users.go:26-49 | pkg/sdk/go/users.go:51-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) cmd/postgres-reader/main.go:41— cmd/postgres-reader/main.go:41-103 | cmd/timescale-reader/main.go:39-94 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 32+ corresponding lines) · ×1
Edited copies of one member (7 members, 32+ corresponding lines) auth/postgres/invites.go:30— auth/postgres/invites.go:30-72 | auth/postgres/memberships.go:130-165 | auth/postgres/memberships.go:167-202 | auth/postgres/roles.go:129-160 | consumers/alarms/postgres/alarms.go:31-67 | things/postgres/memberships.go:28-60 | users/postgres/invites.go:30-69 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 25+ corresponding lines) · ×1
Edited copies of one member (5 members, 25+ corresponding lines) cmd/downlinks/main.go:275— cmd/downlinks/main.go:275-299 | cmd/filestore/main.go:332-358 | cmd/modbus/main.go:273-297 | cmd/rules/main.go:268-293 | cmd/uiconfigs/main.go:261-289 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 31+ corresponding lines) · ×1
Edited copies of one member (5 members, 31+ corresponding lines) consumers/notifiers/api/http/transport.go:125— consumers/notifiers/api/http/transport.go:125-155 | things/api/http/profiles/transport.go:214-244 | things/api/http/things/transport.go:297-327 | users/api/http/users/transport.go:242-278 | webhooks/api/http/transport.go:139-169 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 25+ corresponding lines) · ×1
Edited copies of one member (4 members, 25+ corresponding lines) auth/api/http/orgs/endpoint.go:34— auth/api/http/orgs/endpoint.go:34-58 | things/api/http/groups/endpoint.go:58-82 | things/api/http/groups/endpoint.go:84-108 | things/api/http/groups/endpoint.go:110-134 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 24+ corresponding lines) · ×1
Edited copies of one member (6 members, 24+ corresponding lines) cmd/audit/main.go:245— cmd/audit/main.go:245-272 | cmd/postgres-reader/main.go:270-298 | cmd/shadows/main.go:261-284 | cmd/smpp-notifier/main.go:325-351 | cmd/timescale-reader/main.go:244-270 | cmd/webhooks/main.go:274-300 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 24+ corresponding lines) · ×1
Edited copies of one member (4 members, 24+ corresponding lines) consumers/notifiers/api/http/endpoint.go:15— consumers/notifiers/api/http/endpoint.go:15-39 | rules/api/http/scripts/endpoint.go:16-42 | things/api/http/memberships/endpoint.go:15-38 | things/api/http/memberships/endpoint.go:56-79 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 26+ corresponding lines) · ×1
Edited copies of one member (4 members, 26+ corresponding lines) consumers/notifiers/api/http/endpoint.go:110— consumers/notifiers/api/http/endpoint.go:110-135 | things/api/http/profiles/endpoint.go:216-241 | things/api/http/things/endpoint.go:336-363 | webhooks/api/http/endpoint.go:128-155 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) auth/postgres/memberships.go:239— auth/postgres/memberships.go:239-259 | things/postgres/memberships.go:122-143 | users/postgres/identity.go:61-80 | users/postgres/users.go:224-249 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 24+ corresponding lines) · ×1
Edited copies of one member (8 members, 24+ corresponding lines) pkg/sdk/go/group_memberships.go:63— pkg/sdk/go/group_memberships.go:63-87 | pkg/sdk/go/groups.go:88-112 | pkg/sdk/go/org_memberships.go:132-160 | pkg/sdk/go/profiles.go:202-225 | pkg/sdk/go/things.go:255-279 | pkg/sdk/go/things.go:317-342 | pkg/sdk/go/users.go:199-225 | pkg/sdk/go/webhooks.go:164-187 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) filestore/api/http/transport.go:263— filestore/api/http/transport.go:263-287 | filestore/api/http/transport.go:366-391 | filestore/api/http/transport.go:393-417 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 24+ corresponding lines) · ×1
Edited copies of one member (5 members, 24+ corresponding lines) things/redis/events/streams.go:53— things/redis/events/streams.go:53-80 | things/redis/events/streams.go:82-109 | things/redis/events/streams.go:174-201 | things/redis/events/streams.go:203-227 | things/redis/events/streams.go:229-252 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 21+ corresponding lines) · ×1
Edited copies of one member (7 members, 21+ corresponding lines) filestore/api/http/endpoint.go:51— filestore/api/http/endpoint.go:51-71 | filestore/api/http/endpoint.go:73-93 | filestore/api/http/endpoint.go:95-115 | filestore/api/http/endpoint.go:153-173 | filestore/api/http/endpoint.go:175-195 | filestore/api/http/endpoint.go:197-217 | filestore/api/http/endpoint.go:219-239 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 15+ corresponding lines) · ×1
Edited copies of one member (5 members, 15+ corresponding lines) auth/postgres/sessions.go:45— auth/postgres/sessions.go:45-59 | shadows/postgres/shadows.go:89-109 | uiconfigs/postgres/groups.go:67-86 | uiconfigs/postgres/orgs.go:67-86 | uiconfigs/postgres/things.go:67-86 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 18+ corresponding lines) · ×1
Edited copies of one member (6 members, 18+ corresponding lines) pkg/sdk/go/groups.go:69— pkg/sdk/go/groups.go:69-86 | pkg/sdk/go/invites.go:63-80 | pkg/sdk/go/keys.go:67-84 | pkg/sdk/go/orgs.go:102-119 | pkg/sdk/go/profiles.go:183-200 | pkg/sdk/go/things.go:235-253 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×1
Edited copies of one member (4 members, 13+ corresponding lines) things/redis/groups.go:84— things/redis/groups.go:84-96 | things/redis/profiles.go:31-43 | things/redis/things.go:37-53 | things/redis/things.go:125-137 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 15+ corresponding lines) · ×1
Edited copies of one member (7 members, 15+ corresponding lines) consumers/notifiers/api/http/endpoint.go:41— consumers/notifiers/api/http/endpoint.go:41-55 | things/api/http/groups/endpoint.go:152-166 | things/api/http/profiles/endpoint.go:126-140 | things/api/http/profiles/endpoint.go:142-156 | things/api/http/things/endpoint.go:129-144 | things/api/http/things/endpoint.go:146-160 | things/api/http/things/endpoint.go:162-176 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) filestore/postgres/groups.go:267— filestore/postgres/groups.go:267-289 | filestore/postgres/things.go:303-325 | things/postgres/things.go:462-482 | users/postgres/users.go:291-308 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 22+ corresponding lines) · ×1
Edited copies of one member (4 members, 22+ corresponding lines) audit/postgres/events.go:31— audit/postgres/events.go:31-52 | auth/postgres/invites.go:74-100 | filestore/postgres/groups.go:31-52 | filestore/postgres/things.go:31-53 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 19+ corresponding lines) · ×1
Edited copies of one member (8 members, 19+ corresponding lines) auth/api/grpc/endpoint.go:138— auth/api/grpc/endpoint.go:138-159 | things/api/grpc/endpoint.go:53-72 | things/api/grpc/endpoint.go:74-94 | things/api/grpc/endpoint.go:96-115 | things/api/grpc/endpoint.go:117-136 | things/api/grpc/endpoint.go:138-159 | things/api/grpc/endpoint.go:161-179 | things/api/grpc/endpoint.go:181-199 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) readers/api/grpc/requests.go:17— readers/api/grpc/requests.go:17-38 | readers/api/http/messages/requests.go:286-307 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 21+ corresponding lines) · ×1
Edited copies of one member (8 members, 21+ corresponding lines) auth/postgres/orgs.go:181— auth/postgres/orgs.go:181-201 | downlinks/postgres/downlinks.go:201-223 | things/postgres/groups.go:157-177 | things/postgres/profiles.go:124-144 | things/postgres/things.go:186-206 | uiconfigs/postgres/groups.go:181-202 | uiconfigs/postgres/orgs.go:181-202 | uiconfigs/postgres/things.go:195-216 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 15+ corresponding lines) · ×1
Edited copies of one member (8 members, 15+ corresponding lines) audit/api/http/endpoint.go:45— audit/api/http/endpoint.go:45-59 | consumers/alarms/api/http/endpoint.go:16-30 | downlinks/api/http/endpoint.go:66-80 | modbus/api/http/endpoint.go:100-114 | rules/api/http/rules/endpoint.go:65-79 | rules/api/http/scripts/endpoint.go:44-58 | things/api/http/memberships/endpoint.go:40-54 | webhooks/api/http/endpoint.go:42-56 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 15+ corresponding lines) · ×1
Edited copies of one member (6 members, 15+ corresponding lines) consumers/alarms/api/http/endpoint.go:32— consumers/alarms/api/http/endpoint.go:32-46 | downlinks/api/http/endpoint.go:50-64 | modbus/api/http/endpoint.go:84-98 | rules/api/http/rules/endpoint.go:49-63 | rules/api/http/scripts/endpoint.go:113-127 | webhooks/api/http/endpoint.go:58-72 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) things/service.go:973— things/service.go:973-988 | things/service.go:1034-1049 | things/service.go:1051-1066 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) auth/postgres/invites.go:484— auth/postgres/invites.go:484-506 | things/postgres/profiles.go:211-231 | things/postgres/things.go:327-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 19+ corresponding lines) · ×1
Edited copies of one member (5 members, 19+ corresponding lines) auth/postgres/roles.go:91— auth/postgres/roles.go:91-111 | certs/postgres/certs.go:340-362 | consumers/alarms/postgres/alarms.go:69-87 | filestore/postgres/groups.go:88-112 | filestore/postgres/things.go:89-113 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 13+ corresponding lines) · ×1
Edited copies of one member (8 members, 13+ corresponding lines) consumers/alarms/service.go:88— consumers/alarms/service.go:88-100 | consumers/alarms/service.go:102-114 | consumers/alarms/service.go:177-189 | consumers/notifiers/service.go:147-159 | rules/service.go:211-223 | rules/service.go:225-237 | webhooks/service.go:122-134 | webhooks/service.go:136-148 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 8+ corresponding lines) · ×1
Edited copies of one member (5 members, 8+ corresponding lines) auth/emailer/metrics.go:26— auth/emailer/metrics.go:26-33 | things/emailer/metrics.go:26-33 | users/emailer/metrics.go:27-34 | users/emailer/metrics.go:36-43 | users/emailer/metrics.go:45-52 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 12+ corresponding lines) · ×1
Edited copies of one member (7 members, 12+ corresponding lines) consumers/notifiers/service.go:161— consumers/notifiers/service.go:161-172 | rules/service.go:239-250 | rules/service.go:252-263 | rules/service.go:365-376 | rules/service.go:418-429 | uiconfigs/service.go:245-256 | webhooks/service.go:150-161 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 21+ corresponding lines) · ×1
Edited copies of one member (5 members, 21+ corresponding lines) consumers/notifiers/api/http/requests.go:76— consumers/notifiers/api/http/requests.go:76-96 | downlinks/api/http/requests.go:63-83 | modbus/api/http/requests.go:79-99 | rules/api/http/rules/requests.go:39-59 | webhooks/api/http/requests.go:53-73 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×1
Edited copies of one member (4 members, 16+ corresponding lines) downlinks/service.go:252— downlinks/service.go:252-267 | downlinks/service.go:269-284 | modbus/service.go:500-515 | modbus/service.go:517-532 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 17+ corresponding lines) · ×1
Edited copies of one member (5 members, 17+ corresponding lines) pkg/apiutil/transport.go:310— pkg/apiutil/transport.go:310-327 | pkg/apiutil/transport.go:329-346 | pkg/apiutil/transport.go:349-370 | pkg/apiutil/transport.go:407-423 | pkg/apiutil/transport.go:426-443 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 10+ corresponding lines) · ×1
Edited copies of one member (6 members, 10+ corresponding lines) auth/api/grpc/client.go:210— auth/api/grpc/client.go:210-221 | auth/api/grpc/client.go:244-255 | auth/api/grpc/client.go:392-403 | auth/api/grpc/client.go:436-447 | things/api/grpc/client.go:292-304 | things/api/grpc/client.go:306-315 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) readers/postgres/json.go:132— readers/postgres/json.go:132-141 | readers/postgres/senml.go:40-49 | readers/timescale/json.go:46-55 | readers/timescale/senml.go:46-55 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) consumers/alarms/postgres/alarms.go:220— consumers/alarms/postgres/alarms.go:220-229 | consumers/notifiers/postgres/notifiers.go:194-203 | rules/postgres/rules.go:242-251 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 7+ corresponding lines) · ×1
Edited copies of one member (7 members, 7+ corresponding lines) auth/tracing/orgs.go:80— auth/tracing/orgs.go:80-86 | things/tracing/groups.go:86-92 | things/tracing/profiles.go:103-109 | things/tracing/things.go:126-132 | uiconfigs/tracing/groups.go:54-60 | uiconfigs/tracing/orgs.go:54-60 | uiconfigs/tracing/things.go:55-61 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 7+ corresponding lines) · ×1
Edited copies of one member (5 members, 7+ corresponding lines) auth/tracing/sessions.go:46— auth/tracing/sessions.go:46-52 | filestore/tracing/groups.go:63-69 | filestore/tracing/things.go:66-72 | readers/tracing/json.go:36-42 | readers/tracing/senml.go:36-42 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) consumers/writers/postgres/consumer.go:20— consumers/writers/postgres/consumer.go:20-29 | consumers/writers/timescale/consumer.go:20-29 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×1
Edited copy of a member (6 corresponding lines) consumers/alarms/api/http/converters.go:98— consumers/alarms/api/http/converters.go:98-103 | readers/api/http/messages/converters.go:175-180 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) things/api/grpc/client.go:567— things/api/grpc/client.go:567-570 | things/api/grpc/server.go:303-306 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (41 lines × 2) readers/postgres/json.go:37— readers/postgres/json.go:37-77 | readers/timescale/json.go:114-154 — `readers/postgres/json.go` and `readers/timescale/json.go` 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 114 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (37–38 lines × 2) auth/postgres/invites.go:324— auth/postgres/invites.go:324-360 | auth/postgres/invites.go:405-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:324` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (34–35 lines × 2) cli/profiles.go:31— cli/profiles.go:31-65 | cli/things.go:32-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/profiles.go:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (26–28 lines × 2) pkg/sdk/go/groups.go:193— pkg/sdk/go/groups.go:193-218 | pkg/sdk/go/orgs.go:171-198 — before extracting anything, compare `pkg/sdk/go/groups.go` and `pkg/sdk/go/orgs.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/orgs.go:171` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (27 lines × 4) auth/api/http/backup/transport.go:25— auth/api/http/backup/transport.go:25-51 | readers/api/http/backup/transport.go:31-57 | things/api/http/backup/transport.go:31-57 | users/api/http/backup/transport.go:30-56 — before extracting anything, compare `auth/api/http/backup/transport.go` and `readers/api/http/backup/transport.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/transport.go:25` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (26 lines × 2) readers/postgres/senml.go:75— readers/postgres/senml.go:75-100 | readers/timescale/senml.go:116-141 — `readers/postgres/senml.go` and `readers/timescale/senml.go` 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 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 (25 lines × 3) uiconfigs/postgres/groups.go:141— uiconfigs/postgres/groups.go:141-165 | uiconfigs/postgres/orgs.go:141-165 | uiconfigs/postgres/things.go:141-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `uiconfigs/postgres/groups.go:141` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23–25 lines × 2) users/postgres/users.go:46— users/postgres/users.go:46-68 | users/postgres/verifications.go:35-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `users/postgres/users.go:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (23 lines × 3) things/api/http/groups/transport.go:212— things/api/http/groups/transport.go:212-234 | things/api/http/profiles/transport.go:247-269 | things/api/http/things/transport.go:330-352 — `things/api/http/groups/transport.go` and `things/api/http/profiles/transport.go` 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 134 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `things/api/http/groups/transport.go:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) filestore/postgres/groups.go:59— filestore/postgres/groups.go:59-81 | filestore/postgres/things.go:60-82 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `filestore/postgres/groups.go:59` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 3) cli/group_memberships.go:73— cli/group_memberships.go:73-93 | cli/org_memberships.go:87-108 | cli/webhooks.go:90-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cli/group_memberships.go:73` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–22 lines × 2) pkg/sdk/go/certs.go:58— pkg/sdk/go/certs.go:58-77 | pkg/sdk/go/certs.go:140-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (21 lines × 3) pkg/sdk/go/messages.go:215— pkg/sdk/go/messages.go:215-235 | pkg/sdk/go/messages.go:253-273 | pkg/sdk/go/messages.go:278-298 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/messages.go:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `sdk mfSDK) ExportJSONMessages(token` in one and `sdk mfSDK) ExportSenMLMessages(token` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 4) readers/postgres/json.go:49— readers/postgres/json.go:49-68 | readers/postgres/senml.go:87-106 | readers/timescale/json.go:126-145 | readers/timescale/senml.go:128-147 — before extracting anything, compare `readers/postgres/json.go` and `readers/postgres/senml.go` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/json.go:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 3) readers/api/http/messages/transport.go:275— readers/api/http/messages/transport.go:275-293 | readers/api/http/messages/transport.go:313-331 | readers/api/http/messages/transport.go:376-394 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–19 lines × 2) auth/postgres/orgs.go:123— auth/postgres/orgs.go:123-139 | things/postgres/groups.go:126-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:123` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) readers/postgres/json.go:187— readers/postgres/json.go:187-204 | readers/postgres/senml.go:183-201 — before extracting anything, compare `readers/postgres/json.go` and `readers/postgres/senml.go` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/json.go:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–18 lines × 10) consumers/notifiers/postgres/notifiers.go:162— consumers/notifiers/postgres/notifiers.go:162-179 | downlinks/postgres/downlinks.go:261-278 | filestore/postgres/groups.go:69-86 | filestore/postgres/things.go:70-87 | modbus/postgres/clients.go:285-302 | rules/postgres/rules.go:212-227 | rules/postgres/scripts.go:152-169 | things/postgres/profiles.go:86-103 | things/postgres/things.go:432-449 | webhooks/postgres/webhooks.go:165-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 10 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 10 times. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/notifiers/postgres/notifiers.go:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `consumers/notifiers/postgres/notifiers.go:160` calls `Wrap` and `filestore/postgres/groups.go:67` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 8) auth/postgres/memberships.go:212— auth/postgres/memberships.go:212-229 | consumers/notifiers/postgres/notifiers.go:155-172 | downlinks/postgres/downlinks.go:254-271 | modbus/postgres/clients.go:278-295 | things/postgres/memberships.go:179-196 | things/postgres/profiles.go:79-96 | things/postgres/things.go:425-442 | webhooks/postgres/webhooks.go:158-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 6) auth/api/http/orgs/transport.go:138— auth/api/http/orgs/transport.go:138-155 | consumers/notifiers/api/http/transport.go:172-189 | things/api/http/groups/transport.go:226-243 | things/api/http/profiles/transport.go:261-278 | things/api/http/things/transport.go:344-361 | webhooks/api/http/transport.go:186-203 — before extracting anything, compare `auth/api/http/orgs/transport.go` and `things/api/http/groups/transport.go` as WHOLE FILES: this scan already matched 4 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/orgs/transport.go:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 4) consumers/writers/postgres/consumer.go:58— consumers/writers/postgres/consumer.go:58-75 | consumers/writers/postgres/consumer.go:102-119 | consumers/writers/timescale/consumer.go:58-75 | consumers/writers/timescale/consumer.go:102-119 — `consumers/writers/postgres/consumer.go` and `consumers/writers/timescale/consumer.go` 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 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/writers/postgres/consumer.go:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `consumers/writers/postgres/consumer.go:120` calls `PayloadHash` and `consumers/writers/postgres/consumer.go:76` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 3) cmd/alarms/main.go:221— cmd/alarms/main.go:221-238 | cmd/rules/main.go:214-231 | cmd/webhooks/main.go:220-237 — `cmd/alarms/main.go` and `cmd/rules/main.go` 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 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:221` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 5) cmd/downlinks/main.go:209— cmd/downlinks/main.go:209-225 | cmd/mqtt/main.go:293-309 | cmd/rules/main.go:202-218 | cmd/shadows/main.go:206-222 | cmd/uiconfigs/main.go:196-212 — `cmd/downlinks/main.go` and `cmd/mqtt/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 12) cmd/alarms/main.go:258— cmd/alarms/main.go:258-273 | cmd/downlinks/main.go:258-273 | cmd/filestore/main.go:315-330 | cmd/modbus/main.go:256-271 | cmd/mqtt/main.go:354-369 | cmd/postgres-reader/main.go:244-259 | cmd/rules/main.go:251-266 | cmd/smpp-notifier/main.go:308-323 | cmd/smtp-notifier/main.go:305-320 | cmd/timescale-reader/main.go:218-233 | cmd/uiconfigs/main.go:244-259 | cmd/webhooks/main.go:257-272 — `cmd/alarms/main.go` and `cmd/downlinks/main.go` 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 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:258` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (16 lines × 8) pkg/sdk/go/group_memberships.go:46— pkg/sdk/go/group_memberships.go:46-61 | pkg/sdk/go/groups.go:257-272 | pkg/sdk/go/org_memberships.go:115-130 | pkg/sdk/go/orgs.go:85-100 | pkg/sdk/go/profiles.go:166-181 | pkg/sdk/go/things.go:218-233 | pkg/sdk/go/users.go:182-197 | pkg/sdk/go/webhooks.go:147-162 — before extracting anything, compare `pkg/sdk/go/group_memberships.go` and `pkg/sdk/go/groups.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/group_memberships.go:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/sdk/go/group_memberships.go:45` calls `Sprintf` and `pkg/sdk/go/org_memberships.go:113` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 5) cmd/downlinks/main.go:221— cmd/downlinks/main.go:221-236 | cmd/modbus/main.go:219-234 | cmd/shadows/main.go:218-233 | cmd/timescale-reader/main.go:191-206 | cmd/uiconfigs/main.go:208-223 — `cmd/downlinks/main.go` and `cmd/modbus/main.go` 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 19 separate duplicated blocks between them, totalling at least 211 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:221` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/downlinks/main.go:238` calls `Env` and `cmd/timescale-reader/main.go:208` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 4) pkg/sdk/go/messages.go:122— pkg/sdk/go/messages.go:122-137 | pkg/sdk/go/messages.go:142-157 | pkg/sdk/go/messages.go:162-177 | pkg/sdk/go/messages.go:182-197 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/sdk/go/messages.go:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 3) consumers/alarms/postgres/alarms.go:73— consumers/alarms/postgres/alarms.go:73-87 | filestore/postgres/groups.go:97-112 | filestore/postgres/things.go:98-113 — before extracting anything, compare `filestore/postgres/groups.go` and `filestore/postgres/things.go` as WHOLE FILES: this scan already matched 14 separate duplicated blocks between them, totalling at least 186 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/postgres/alarms.go:73` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 6) cmd/alarms/main.go:204— cmd/alarms/main.go:204-218 | cmd/filestore/main.go:219-233 | cmd/modbus/main.go:202-216 | cmd/smpp-notifier/main.go:251-265 | cmd/smtp-notifier/main.go:241-255 | cmd/webhooks/main.go:203-217 — `cmd/alarms/main.go` and `cmd/filestore/main.go` 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 130 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) pkg/sdk/go/messages.go:347— pkg/sdk/go/messages.go:347-361 | pkg/sdk/go/messages.go:407-420 — both copies are in the same file, so extract the block into 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 × 30) audit/api/http/transport.go:174— audit/api/http/transport.go:174-187 | auth/api/http/backup/transport.go:76-89 | auth/api/http/invites/transport.go:207-220 | auth/api/http/keys/transport.go:119-132 | auth/api/http/memberships/transport.go:182-195 | auth/api/http/orgs/transport.go:242-255 | auth/api/http/sessions/transport.go:52-65 | certs/api/transport.go:119-132 | consumers/alarms/api/http/transport.go:281-294 | consumers/notifiers/api/http/transport.go:256-269 | downlinks/api/http/backup/transport.go:90-103 | downlinks/api/http/transport.go:232-245 | filestore/api/http/transport.go:422-435 | modbus/api/http/transport.go:375-388 | mqtt/api/http/transport.go:84-97 | readers/api/http/backup/transport.go:84-97 | readers/api/http/messages/transport.go:477-490 | rules/api/http/rules/transport.go:265-278 | rules/api/http/scripts/transport.go:224-237 | shadows/api/http/transport.go:100-113 | things/api/http/backup/transport.go:81-94 | things/api/http/groups/transport.go:338-351 | things/api/http/memberships/transport.go:171-184 | things/api/http/profiles/transport.go:371-384 | things/api/http/things/transport.go:554-567 | uiconfigs/api/http/backup/transport.go:91-104 | uiconfigs/api/http/groups/transport.go:109-122 | uiconfigs/api/http/orgs/transport.go:110-123 | uiconfigs/api/http/things/transport.go:109-122 | webhooks/api/http/transport.go:301-314 — before extracting anything, compare `auth/api/http/backup/transport.go` and `downlinks/api/http/backup/transport.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `audit/api/http/transport.go:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 13) cmd/alarms/main.go:255— cmd/alarms/main.go:255-268 | REDACTED:302-315 | cmd/downlinks/main.go:255-268 | cmd/filestore/main.go:312-325 | cmd/modbus/main.go:253-266 | cmd/mqtt/main.go:351-364 | cmd/postgres-reader/main.go:241-254 | cmd/rules/main.go:248-261 | cmd/shadows/main.go:243-256 | cmd/smpp-notifier/main.go:305-318 | cmd/smtp-notifier/main.go:302-315 | cmd/timescale-reader/main.go:215-228 | cmd/webhooks/main.go:254-267 — `cmd/alarms/main.go` and `REDACTED` 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 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 5) cmd/alarms/main.go:114— cmd/alarms/main.go:114-127 | cmd/postgres-writer/main.go:68-81 | cmd/smpp-notifier/main.go:132-145 | cmd/smtp-notifier/main.go:140-153 | cmd/timescale-writer/main.go:67-80 — `cmd/alarms/main.go` and `cmd/postgres-writer/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/alarms/main.go:129` calls `Init`, `Close` and `cmd/postgres-writer/main.go:83` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) auth/postgres/invites.go:207— auth/postgres/invites.go:207-219 | users/postgres/verifications.go:90-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:207` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 20) cmd/alarms/main.go:193— cmd/alarms/main.go:193-205 | cmd/audit/main.go:170-182 | cmd/auth/main.go:233-245 | REDACTED:229-241 | cmd/downlinks/main.go:198-210 | cmd/filestore/main.go:208-220 | cmd/modbus/main.go:191-203 | cmd/mqtt/main.go:282-294 | cmd/postgres-reader/main.go:172-184 | cmd/postgres-writer/main.go:113-125 | cmd/rules/main.go:191-203 | cmd/shadows/main.go:195-207 | cmd/smpp-notifier/main.go:240-252 | cmd/smtp-notifier/main.go:230-242 | cmd/things/main.go:280-292 | cmd/timescale-reader/main.go:155-167 | cmd/timescale-writer/main.go:111-123 | cmd/uiconfigs/main.go:185-197 | cmd/users/main.go:249-261 | cmd/webhooks/main.go:192-204 — `cmd/alarms/main.go` and `cmd/audit/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:193` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/alarms/main.go:207` calls `Env` and `cmd/postgres-reader/main.go:186` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 6) auth/postgres/invites.go:278— auth/postgres/invites.go:278-292 | auth/postgres/invites.go:468-480 | auth/postgres/invites.go:518-530 | users/postgres/invites.go:175-189 | users/postgres/invites.go:201-213 | users/postgres/invites.go:225-237 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) things/api/http/backup/endpoint.go:59— things/api/http/backup/endpoint.go:59-71 | things/api/http/backup/endpoint.go:111-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `things/api/http/backup/endpoint.go:59` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 6) auth/api/http/backup/transport.go:23— auth/api/http/backup/transport.go:23-34 | downlinks/api/http/backup/transport.go:28-39 | readers/api/http/backup/transport.go:29-40 | things/api/http/backup/transport.go:29-40 | uiconfigs/api/http/backup/transport.go:29-40 | users/api/http/backup/transport.go:28-39 — before extracting anything, compare `auth/api/http/backup/transport.go` and `downlinks/api/http/backup/transport.go` 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/backup/transport.go:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 3) cmd/coap/main.go:80— cmd/coap/main.go:80-90 | cmd/http/main.go:64-74 | REDACTED:64-75 — `cmd/coap/main.go` and `cmd/http/main.go` 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 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 6) cmd/alarms/main.go:209— cmd/alarms/main.go:209-219 | REDACTED:245-255 | cmd/converters/main.go:162-172 | cmd/filestore/main.go:224-234 | cmd/modbus/main.go:207-217 | cmd/webhooks/main.go:208-218 — `cmd/alarms/main.go` and `REDACTED` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:209` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/alarms/main.go:206` calls `Env` and `cmd/converters/main.go:160` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 5) cmd/audit/main.go:107— cmd/audit/main.go:107-117 | cmd/auth/main.go:155-164 | cmd/mqtt/main.go:145-155 | cmd/rules/main.go:105-114 | cmd/users/main.go:171-180 — `cmd/audit/main.go` and `cmd/auth/main.go` 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 54 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10–11 lines × 4) readers/postgres/aggregations.go:83— readers/postgres/aggregations.go:83-92 | readers/postgres/senml.go:55-65 | readers/timescale/aggregations.go:92-102 | readers/timescale/senml.go:61-71 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/aggregations.go:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 15) audit/postgres/init.go:30— audit/postgres/init.go:30-39 | auth/postgres/init.go:33-42 | consumers/alarms/postgres/init.go:33-42 | consumers/notifiers/postgres/init.go:32-41 | consumers/writers/postgres/init.go:34-44 | consumers/writers/timescale/init.go:34-44 | downlinks/postgres/init.go:31-40 | filestore/postgres/init.go:31-41 | modbus/postgres/init.go:33-43 | mqtt/postgres/init.go:31-41 | shadows/postgres/init.go:27-36 | things/postgres/init.go:34-44 | uiconfigs/postgres/init.go:31-41 | users/postgres/init.go:35-44 | webhooks/postgres/init.go:32-41 — before extracting anything, compare `audit/postgres/init.go` and `auth/postgres/init.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `audit/postgres/init.go:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 13) audit/postgres/init.go:81— audit/postgres/init.go:81-90 | auth/postgres/init.go:189-198 | certs/postgres/init.go:109-118 | consumers/alarms/postgres/init.go:91-100 | consumers/writers/postgres/init.go:145-154 | consumers/writers/timescale/init.go:113-122 | downlinks/postgres/init.go:121-130 | filestore/postgres/init.go:106-115 | modbus/postgres/init.go:77-86 | mqtt/postgres/init.go:90-99 | rules/postgres/init.go:191-200 | things/postgres/init.go:210-219 | users/postgres/init.go:125-134 — before extracting anything, compare `audit/postgres/init.go` and `auth/postgres/init.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `audit/postgres/init.go:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 11) auth/postgres/orgs.go:108— auth/postgres/orgs.go:108-117 | consumers/notifiers/postgres/notifiers.go:151-160 | downlinks/postgres/downlinks.go:250-259 | filestore/postgres/groups.go:60-69 | filestore/postgres/things.go:61-70 | modbus/postgres/clients.go:274-283 | things/postgres/things.go:421-430 | uiconfigs/postgres/groups.go:137-146 | uiconfigs/postgres/orgs.go:137-146 | uiconfigs/postgres/things.go:137-146 | webhooks/postgres/webhooks.go:154-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 11 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 11 times. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `consumers/notifiers/postgres/notifiers.go:162` calls `Wrap` and `filestore/postgres/groups.go:70` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 8) cmd/alarms/main.go:209— cmd/alarms/main.go:209-218 | REDACTED:245-254 | cmd/converters/main.go:162-171 | cmd/filestore/main.go:224-233 | cmd/modbus/main.go:207-216 | cmd/smpp-notifier/main.go:256-265 | cmd/smtp-notifier/main.go:246-255 | cmd/webhooks/main.go:208-217 — `cmd/alarms/main.go` and `REDACTED` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:209` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/alarms/main.go:206` calls `Env` and `cmd/converters/main.go:160` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 8) consumers/alarms/api/http/transport.go:226— consumers/alarms/api/http/transport.go:226-235 | consumers/notifiers/api/http/transport.go:227-235 | rules/api/http/rules/transport.go:209-217 | rules/api/http/scripts/transport.go:164-173 | things/api/http/profiles/transport.go:170-178 | things/api/http/things/transport.go:253-261 | things/api/http/things/transport.go:269-278 | webhooks/api/http/transport.go:271-280 — there are 8 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/alarms/api/http/transport.go:226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 6) rules/api/http/rules/transport.go:135— rules/api/http/rules/transport.go:135-143 | rules/api/http/scripts/transport.go:115-124 | things/api/http/memberships/transport.go:123-132 | things/api/http/memberships/transport.go:140-149 | things/api/http/memberships/transport.go:157-166 | uiconfigs/api/http/groups/transport.go:96-104 — `rules/api/http/rules/transport.go` and `rules/api/http/scripts/transport.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `rules/api/http/rules/transport.go:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) REDACTED:261— REDACTED:261-270 | cmd/coap/main.go:166-175 | cmd/timescale-reader/main.go:183-192 | REDACTED:116-125 — `REDACTED` and `cmd/timescale-reader/main.go` 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 66 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) readers/postgres/aggregations.go:399— readers/postgres/aggregations.go:399-408 | readers/postgres/json.go:106-115 | readers/timescale/aggregations.go:226-234 | readers/timescale/json.go:183-192 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `readers/postgres/aggregations.go:399` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) auth/api/http/invites/transport.go:113— auth/api/http/invites/transport.go:113-122 | auth/api/http/memberships/transport.go:168-177 | uiconfigs/api/http/orgs/transport.go:97-105 — `auth/api/http/invites/transport.go` and `auth/api/http/memberships/transport.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/invites/transport.go:113` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–10 lines × 2) http/adapter.go:22— http/adapter.go:22-28 | ws/adapter.go: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ws/adapter.go:24` calls `Subscribe`, `Unsubscribe` and `http/adapter.go:20` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 14) cmd/alarms/main.go:182— cmd/alarms/main.go:182-190 | cmd/coap/main.go:160-168 | cmd/converters/main.go:149-157 | cmd/downlinks/main.go:182-190 | cmd/http/main.go:127-135 | cmd/modbus/main.go:180-188 | cmd/mqtt/main.go:261-269 | cmd/postgres-reader/main.go:197-205 | cmd/rules/main.go:175-183 | cmd/shadows/main.go:179-187 | cmd/timescale-reader/main.go:172-180 | cmd/uiconfigs/main.go:169-177 | cmd/webhooks/main.go:181-189 | REDACTED:110-118 — `cmd/alarms/main.go` and `cmd/converters/main.go` 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 74 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) auth/postgres/orgs.go:107— auth/postgres/orgs.go:107-115 | consumers/notifiers/postgres/notifiers.go:150-158 | downlinks/postgres/downlinks.go:249-257 | filestore/postgres/groups.go:59-67 | filestore/postgres/things.go:60-68 | modbus/postgres/clients.go:273-281 | rules/postgres/rules.go:202-210 | things/postgres/things.go:420-428 | uiconfigs/postgres/groups.go:136-144 | uiconfigs/postgres/orgs.go:136-144 | uiconfigs/postgres/things.go:136-144 | webhooks/postgres/webhooks.go:153-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 12 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 12 times. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/orgs.go:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) auth/postgres/invites.go:49— auth/postgres/invites.go:49-57 | auth/postgres/invites.go:86-94 | auth/postgres/invites.go:546-554 | auth/postgres/memberships.go:183-191 | things/postgres/things.go:302-310 — 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 (8 lines × 14) audit/postgres/init.go:81— audit/postgres/init.go:81-88 | auth/postgres/init.go:189-196 | certs/postgres/init.go:109-116 | consumers/alarms/postgres/init.go:91-98 | consumers/writers/postgres/init.go:145-152 | consumers/writers/timescale/init.go:113-120 | downlinks/postgres/init.go:121-128 | filestore/postgres/init.go:106-113 | modbus/postgres/init.go:77-84 | mqtt/postgres/init.go:90-97 | rules/postgres/init.go:191-198 | things/postgres/init.go:210-217 | uiconfigs/postgres/init.go:84-91 | users/postgres/init.go:125-132 — before extracting anything, compare `audit/postgres/init.go` and `auth/postgres/init.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `audit/postgres/init.go:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 9) cmd/alarms/main.go:113— cmd/alarms/main.go:113-120 | REDACTED:138-145 | cmd/postgres-reader/main.go:106-113 | cmd/postgres-writer/main.go:67-74 | cmd/smpp-notifier/main.go:131-138 | cmd/smtp-notifier/main.go:139-146 | cmd/things/main.go:156-163 | cmd/timescale-reader/main.go:97-104 | cmd/timescale-writer/main.go:66-73 — `cmd/alarms/main.go` and `REDACTED` 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 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 × 7) cmd/alarms/main.go:212— cmd/alarms/main.go:212-219 | REDACTED:248-255 | cmd/converters/main.go:165-172 | cmd/filestore/main.go:227-234 | cmd/modbus/main.go:210-217 | cmd/postgres-reader/main.go:207-214 | cmd/webhooks/main.go:211-218 — `cmd/alarms/main.go` and `REDACTED` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 5) auth/postgres/invites.go:48— auth/postgres/invites.go:48-54 | auth/postgres/invites.go:545-551 | auth/postgres/memberships.go:182-188 | consumers/alarms/postgres/alarms.go:47-53 | users/postgres/invites.go:48-55 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `consumers/alarms/postgres/alarms.go:56` calls `Wrap` and `auth/postgres/invites.go:56` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–8 lines × 3) auth/api/grpc/server.go:537— auth/api/grpc/server.go:537-540 | readers/api/grpc/server.go:188-195 | things/api/grpc/server.go:499-506 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `readers/api/grpc/server.go:188` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `readers/api/grpc/server.go:186` calls `Contains`, `Error` and `auth/api/grpc/server.go:537` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 14) auth/postgres/memberships.go:211— auth/postgres/memberships.go:211-217 | auth/postgres/orgs.go:111-117 | consumers/notifiers/postgres/notifiers.go:154-160 | downlinks/postgres/downlinks.go:253-259 | modbus/postgres/clients.go:277-283 | things/postgres/groups.go:118-124 | things/postgres/memberships.go:178-184 | things/postgres/profiles.go:78-84 | things/postgres/things.go:300-306 | things/postgres/things.go:424-430 | uiconfigs/postgres/groups.go:140-146 | uiconfigs/postgres/orgs.go:140-146 | uiconfigs/postgres/things.go:140-146 | webhooks/postgres/webhooks.go:157-163 — there are 14 copies across 13 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 14 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/memberships.go:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 10) cmd/audit/main.go:107— cmd/audit/main.go:107-114 | cmd/auth/main.go:155-161 | cmd/coap/main.go:80-87 | cmd/converters/main.go:71-78 | cmd/filestore/main.go:133-140 | cmd/http/main.go:64-71 | cmd/mqtt/main.go:145-152 | cmd/rules/main.go:105-111 | cmd/users/main.go:171-178 | REDACTED:64-72 — `cmd/audit/main.go` and `cmd/auth/main.go` 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 54 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) cmd/shadows/main.go:161— cmd/shadows/main.go:161-167 | cmd/uiconfigs/main.go:151-157 | cmd/users/main.go:201-207 | cmd/webhooks/main.go:163-169 — `cmd/shadows/main.go` and `cmd/uiconfigs/main.go` 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 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/shadows/main.go:161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/webhooks/main.go:159` calls `Webhooks`, `Error`, `Sprintf` and `cmd/shadows/main.go:159` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 16) audit/postgres/init.go:30— audit/postgres/init.go:30-35 | auth/postgres/init.go:33-38 | certs/postgres/init.go:42-47 | consumers/alarms/postgres/init.go:33-38 | consumers/notifiers/postgres/init.go:32-37 | consumers/writers/postgres/init.go:34-39 | consumers/writers/timescale/init.go:34-39 | downlinks/postgres/init.go:31-36 | filestore/postgres/init.go:31-36 | modbus/postgres/init.go:33-38 | mqtt/postgres/init.go:31-36 | shadows/postgres/init.go:27-32 | things/postgres/init.go:34-39 | uiconfigs/postgres/init.go:31-36 | users/postgres/init.go:35-40 | webhooks/postgres/init.go:32-37 — before extracting anything, compare `audit/postgres/init.go` and `auth/postgres/init.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `audit/postgres/init.go:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–6 lines × 6) auth/api/metrics.go:274— auth/api/metrics.go:274-279 | downlinks/api/metrics.go:137-142 | readers/api/metrics.go:63-68 | things/api/metrics.go:332-337 | uiconfigs/api/metrics.go:191-196 | users/api/metrics.go:260-263 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/metrics.go:274` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 5) auth/postgres/invites.go:48— auth/postgres/invites.go:48-53 | auth/postgres/memberships.go:143-148 | auth/postgres/memberships.go:182-187 | things/postgres/memberships.go:39-44 | users/postgres/invites.go:48-54 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `auth/postgres/invites.go:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) auth/api/http/invites/transport.go:113— auth/api/http/invites/transport.go:113-119 | auth/api/http/memberships/transport.go:135-141 | auth/api/http/memberships/transport.go:168-174 | uiconfigs/api/http/orgs/transport.go:97-102 — `auth/api/http/invites/transport.go` and `auth/api/http/memberships/transport.go` 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. Read the line range as the matched WINDOW rather than a finished unit: at `auth/api/http/invites/transport.go:113` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (4–6 lines × 3) consumers/writers/api/metrics.go:35— consumers/writers/api/metrics.go:35-38 | rules/api/metrics.go:131-136 | shadows/api/metrics.go:73-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `rules/api/metrics.go:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `shadows/api/metrics.go:73` calls `With`, `Add` and `consumers/writers/api/metrics.go:35` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 7) consumers/notifiers/postgres/notifiers.go:46— consumers/notifiers/postgres/notifiers.go:46-50 | rules/postgres/rules.go:48-52 | things/postgres/groups.go:49-53 | things/postgres/things.go:52-56 | uiconfigs/postgres/groups.go:45-49 | uiconfigs/postgres/orgs.go:45-49 | uiconfigs/postgres/things.go:45-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `consumers/notifiers/postgres/notifiers.go:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 4) auth/postgres/orgs.go:235— auth/postgres/orgs.go:235-268 | things/postgres/profiles.go:268-300 | things/postgres/things.go:354-387 | webhooks/postgres/webhooks.go:219-252 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (29 lines × 2) pkg/sdk/go/group_memberships.go:89— pkg/sdk/go/group_memberships.go:89-117 | pkg/sdk/go/org_memberships.go:74-102 — before extracting anything, compare `pkg/sdk/go/group_memberships.go` and `pkg/sdk/go/org_memberships.go` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `sdk mfSDK) ListGroupMemberships(groupID` in one and `sdk mfSDK) ListOrgMemberships(orgID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 5) audit/api/http/requests.go:57— audit/api/http/requests.go:57-67 | consumers/alarms/api/http/requests.go:62-72 | downlinks/api/http/requests.go:145-155 | modbus/api/http/requests.go:291-301 | webhooks/api/http/requests.go:109-119 — 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 (8 lines × 16) cmd/alarms/main.go:245— cmd/alarms/main.go:245-252 | cmd/audit/main.go:236-243 | cmd/auth/main.go:372-380 | REDACTED:322-329 | cmd/downlinks/main.go:245-252 | cmd/filestore/main.go:302-309 | cmd/modbus/main.go:243-250 | cmd/mqtt/main.go:429-436 | cmd/rules/main.go:238-245 | cmd/shadows/main.go:286-293 | cmd/smpp-notifier/main.go:295-302 | cmd/smtp-notifier/main.go:292-299 | cmd/things/main.go:371-378 | cmd/uiconfigs/main.go:231-238 | cmd/users/main.go:343-350 | cmd/webhooks/main.go:244-251 — `cmd/alarms/main.go` and `cmd/audit/main.go` 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 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/alarms/main.go:241` calls `Env` and `cmd/audit/main.go:232` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) consumers/alarms/api/http/requests.go:80— consumers/alarms/api/http/requests.go:80-90 | downlinks/api/http/requests.go:127-137 | modbus/api/http/requests.go:273-283 | webhooks/api/http/requests.go:127-137 — 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 (6 lines × 11) audit/tracing/tracing.go:35— audit/tracing/tracing.go:35-40 | auth/tracing/keys.go:42-48 | auth/tracing/sessions.go:38-44 | certs/tracing/certs.go:49-55 | mqtt/tracing/subscriptions.go:34-40 | uiconfigs/tracing/groups.go:38-44 | uiconfigs/tracing/orgs.go:38-44 | uiconfigs/tracing/things.go:39-45 | users/tracing/identity.go:34-40 | users/tracing/users.go:44-50 | users/tracing/verification.go:31-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 11 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 11 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (6 lines × 34) audit/tracing/tracing.go:49— audit/tracing/tracing.go:49-54 | audit/tracing/tracing.go:56-61 | auth/tracing/invites.go:73-79 | auth/tracing/keys.go:50-56 | auth/tracing/keys.go:66-72 | auth/tracing/memberships.go:64-70 | auth/tracing/memberships.go:72-78 | auth/tracing/orgs.go:88-94 | certs/tracing/certs.go:41-47 | certs/tracing/certs.go:89-95 | consumers/alarms/tracing/alarms.go:50-56 | consumers/alarms/tracing/alarms.go:58-64 | consumers/alarms/tracing/alarms.go:66-72 | consumers/notifiers/tracing/notifiers.go:49-55 | downlinks/tracing/downlinks.go:48-54 | downlinks/tracing/downlinks.go:56-62 | modbus/tracing/clients.go:46-52 | modbus/tracing/clients.go:54-60 | mqtt/tracing/subscriptions.go:42-48 | rules/tracing/rules.go:58-64 | rules/tracing/rules.go:66-72 | rules/tracing/rules.go:74-80 | rules/tracing/scripts.go:41-47 | rules/tracing/scripts.go:81-87 | rules/tracing/scripts.go:89-95 | things/tracing/groups.go:101-107 | things/tracing/groups.go:125-131 | things/tracing/memberships.go:54-60 | things/tracing/profiles.go:71-77 | things/tracing/things.go:94-100 | things/tracing/things.go:102-108 | users/tracing/identity.go:42-48 | webhooks/tracing/webhooks.go:48-54 | webhooks/tracing/webhooks.go:56-62 — there are 34 copies across 19 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 34 sites; resolving a subset leaves the remainder to drift apart. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `orgID` in one and `groupID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 4) auth/api/http/orgs/requests.go:87— auth/api/http/orgs/requests.go:87-103 | things/api/http/groups/requests.go:163-179 | things/api/http/profiles/requests.go:193-209 | things/api/http/things/requests.go:259-275 — 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 (7 lines × 16) auth/tracing/invites.go:41— auth/tracing/invites.go:41-47 | auth/tracing/memberships.go:40-46 | auth/tracing/orgs.go:40-46 | consumers/alarms/tracing/alarms.go:42-48 | consumers/notifiers/tracing/notifiers.go:41-47 | downlinks/tracing/downlinks.go:40-46 | modbus/tracing/clients.go:38-44 | rules/tracing/rules.go:42-48 | rules/tracing/scripts.go:25-31 | rules/tracing/scripts.go:73-79 | things/tracing/groups.go:46-52 | things/tracing/memberships.go:38-44 | things/tracing/profiles.go:47-53 | things/tracing/things.go:46-52 | users/tracing/invites.go:32-38 | webhooks/tracing/webhooks.go:40-46 — there are 16 copies across 15 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 16 sites; resolving a subset leaves the remainder to drift apart. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 12) auth/tracing/memberships.go:96— auth/tracing/memberships.go:96-102 | auth/tracing/orgs.go:72-78 | auth/tracing/roles.go:76-82 | things/tracing/groups.go:78-84 | things/tracing/memberships.go:70-76 | things/tracing/profiles.go:95-101 | things/tracing/things.go:118-124 | uiconfigs/tracing/groups.go:78-84 | uiconfigs/tracing/orgs.go:78-84 | uiconfigs/tracing/things.go:87-93 | users/tracing/identity.go:50-56 | users/tracing/users.go:100-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 12 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 12 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (14 lines × 6) consumers/notifiers/api/http/transport.go:191— consumers/notifiers/api/http/transport.go:191-204 | consumers/notifiers/api/http/transport.go:206-219 | webhooks/api/http/transport.go:205-218 | webhooks/api/http/transport.go:220-233 | webhooks/api/http/transport.go:235-248 | webhooks/api/http/transport.go:250-263 — before extracting anything, compare `consumers/notifiers/api/http/transport.go` and `webhooks/api/http/transport.go` as WHOLE FILES: this scan already matched 7 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 (14 lines × 4) downlinks/api/http/transport.go:161— downlinks/api/http/transport.go:161-174 | downlinks/api/http/transport.go:176-189 | modbus/api/http/transport.go:278-291 | modbus/api/http/transport.go:293-306 — before extracting anything, compare `downlinks/api/http/transport.go` and `modbus/api/http/transport.go` as WHOLE FILES: this scan already matched 6 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 (20 lines × 5) cmd/downlinks/main.go:52— cmd/downlinks/main.go:52-71 | cmd/rules/main.go:45-64 | cmd/shadows/main.go:47-66 | cmd/uiconfigs/main.go:49-68 | cmd/webhooks/main.go:52-71 — `cmd/downlinks/main.go` and `cmd/rules/main.go` 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 165 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 × 13) cmd/alarms/main.go:258— cmd/alarms/main.go:258-270 | cmd/downlinks/main.go:258-270 | cmd/filestore/main.go:315-327 | cmd/modbus/main.go:256-268 | cmd/mqtt/main.go:354-366 | cmd/postgres-reader/main.go:244-256 | cmd/rules/main.go:251-263 | cmd/smpp-notifier/main.go:308-320 | cmd/smtp-notifier/main.go:305-317 | cmd/things/main.go:393-405 | cmd/timescale-reader/main.go:218-230 | cmd/uiconfigs/main.go:244-256 | cmd/webhooks/main.go:257-269 — `cmd/alarms/main.go` and `cmd/downlinks/main.go` 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 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:258` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 23) cmd/alarms/main.go:166— cmd/alarms/main.go:166-176 | cmd/audit/main.go:153-163 | cmd/auth/main.go:217-226 | REDACTED:208-218 | cmd/coap/main.go:128-138 | cmd/converters/main.go:133-142 | cmd/downlinks/main.go:166-176 | cmd/filestore/main.go:181-191 | cmd/http/main.go:111-120 | cmd/modbus/main.go:164-174 | cmd/mqtt/main.go:245-255 | cmd/postgres-reader/main.go:155-165 | cmd/postgres-writer/main.go:95-105 | cmd/rules/main.go:160-169 | cmd/shadows/main.go:163-173 | cmd/smpp-notifier/main.go:184-194 | cmd/smtp-notifier/main.go:192-202 | cmd/things/main.go:233-243 | cmd/timescale-reader/main.go:138-148 | cmd/timescale-writer/main.go:94-104 | cmd/uiconfigs/main.go:153-163 | cmd/webhooks/main.go:165-175 | REDACTED:93-104 — `cmd/alarms/main.go` and `cmd/audit/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/alarms/main.go:164` calls `Go`, `subscribeToThingsES` and `cmd/converters/main.go:132` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 8) cmd/alarms/main.go:136— cmd/alarms/main.go:136-144 | cmd/downlinks/main.go:126-134 | cmd/modbus/main.go:124-132 | cmd/shadows/main.go:121-129 | cmd/smpp-notifier/main.go:154-162 | cmd/smtp-notifier/main.go:162-170 | cmd/uiconfigs/main.go:120-128 | cmd/webhooks/main.go:135-143 — `cmd/alarms/main.go` and `cmd/downlinks/main.go` 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 128 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 6) cmd/downlinks/main.go:281— cmd/downlinks/main.go:281-288 | cmd/filestore/main.go:340-347 | cmd/modbus/main.go:279-286 | cmd/rules/main.go:276-283 | cmd/uiconfigs/main.go:271-278 | cmd/users/main.go:397-404 — `cmd/downlinks/main.go` and `cmd/filestore/main.go` 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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/downlinks/main.go:281` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) cmd/alarms/main.go:157— cmd/alarms/main.go:157-161 | cmd/rules/main.go:151-155 | cmd/webhooks/main.go:160-164 — `cmd/alarms/main.go` and `cmd/rules/main.go` 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 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/alarms/main.go:157` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
DM10 · One transaction, one aggregate· One operation mutates 4 aggregates · ×1
One operation mutates 4 aggregates: thingsService.Restore things/service.go:870— `thingsService.Restore` saves `GroupRepository`, `ProfileRepository`, `ThingRepository`, `GroupMembershipsRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
DM10 · One transaction, one aggregate· One operation mutates 3 aggregates · ×1
One operation mutates 3 aggregates: configService.Restore uiconfigs/service.go:333— `configService.Restore` saves `OrgConfigRepository`, `ThingConfigRepository`, `GroupConfigRepository` in a single operation. Each is its own consistency boundary, so committing them together makes the second's invariants depend on the first's transaction, holds a lock across both for the whole operation, and means the pair can no longer be separated — into different services, or different databases. Mutate one aggregate here and let the others follow from a domain event.
X3 · Exception handling· Lost error (reports the zero value of a failed type assertion) · ×1
Lost error (reports the zero value of a failed type assertion) readers/timescale/json.go:92— `jsonMsg, ok := msg.(mfjson.Message)` failed on this branch, so `jsonMsg` is the zero value of `mfjson.Message` here, and that is what is reported: the value that did not fit is lost. Report `msg` itself (and `%T` of it) instead.
Interpolated log message defeats structured logging REDACTED:26— `Warn` at line 26 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging REDACTED:63— `Warn` at line 63 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging REDACTED:78— `Debug` at line 78 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Debug("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Debug("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Debug("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging REDACTED:84— `Warn` at line 84 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:40— `Warn` at line 40 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:43— `Info` at line 43 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:53— `Warn` at line 53 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:56— `Info` at line 56 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:66— `Warn` at line 66 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:69— `Info` at line 69 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:80— `Warn` at line 80 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:83— `Info` at line 83 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:93— `Warn` at line 93 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:96— `Info` at line 96 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:107— `Warn` at line 107 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:110— `Info` at line 110 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:120— `Warn` at line 120 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging ws/api/logging.go:123— `Info` at line 123 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:38— `Warn` at line 38 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:41— `Info` at line 41 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:52— `Warn` at line 52 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:55— `Info` at line 55 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:66— `Warn` at line 66 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:69— `Info` at line 69 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Interpolated log message defeats structured logging webhooks/api/logging.go:80— `Warn` at line 80 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Warn("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Warn("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Warn("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Orphaned file cmd/audit/main.go: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 pkg/events/publisher.go: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 users/postgres/invites.go: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 REDACTED: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 tools/provision/provision.go: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 auth/api/http/invites/transport.go: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 rules/api/http/scripts/endpoint.go: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 REDACTED: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 cmd/timescale-writer/main.go: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 auth/mocks/invites.go: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 auth/tracing/invites.go: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 rules/tracing/scripts.go: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 audit/mocks/events.go: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 pkg/sdk/go/invites.go: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 tools/mqtt-bench/bench.go: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 users/postgres/verifications.go: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 rules/api/http/scripts/requests.go: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 users/api/grpc/client.go: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 users/api/grpc/server.go: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 tools/mqtt-bench/cmd/main.go: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 audit/api/logging.go: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 auth/jwt/tokenizer.go: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 REDACTED: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 pkg/domain/users.go: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 mqtt/api/http/transport.go: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.
Duplicated predicate REDACTED:40— `cfg.ServerCert != "" || cfg.ServerKey != ""` appears character-identically in 2 files — REDACTED, pkg/servers/http/http.go. 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 auth/invites.go:166— `err != nil && !errors.Contains(err, dbutil.ErrNotFound)` appears character-identically in 3 files — auth/invites.go, users/invites.go, users/service.go. 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 auth/postgres/key.go:51— `err == sql.ErrNoRows || ok && pgerrcode.InvalidTextRepresentation == pgErr.Code` appears character-identically in 19 files — auth/postgres/key.go, auth/postgres/memberships.go, auth/postgres/orgs.go, auth/postgres/sessions.go. 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 auth/postgres/invites.go:250— `ok && pgErr.Code == pgerrcode.InvalidTextRepresentation` appears character-identically in 2 files — auth/postgres/invites.go, auth/postgres/memberships.go. 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 things/postgres/groups.go:198— `ok && pgerrcode.InvalidTextRepresentation == pgErr.Code` appears character-identically in 2 files — things/postgres/groups.go, things/postgres/things.go. 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 coap/api/transport.go:163— `prefix == topicPrefixGroups && suffix == topicSuffixCommands` appears character-identically in 2 files — coap/api/transport.go, mqtt/handler.go. 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 coap/api/transport.go:161— `prefix == topicPrefixThings && suffix == topicSuffixCommands` appears character-identically in 2 files — coap/api/transport.go, mqtt/handler.go. 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 coap/api/transport.go:165— `prefix == topicPrefixThings && suffix == topicSuffixMessages` appears character-identically in 2 files — coap/api/transport.go, mqtt/handler.go. 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 consumers/notifiers/api/http/requests.go:99— `req.Name == "" || len(req.Name) > maxNameSize` appears character-identically in 9 files — consumers/notifiers/api/http/requests.go, downlinks/api/http/requests.go, modbus/api/http/requests.go, rules/api/http/rules/requests.go. 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 consumers/alarms/api/http/requests.go:172— `req.convertFormat != jsonFormat && req.convertFormat != csvFormat` appears character-identically in 2 files — consumers/alarms/api/http/requests.go, readers/api/http/messages/requests.go. 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 readers/postgres/json.go:47— `rpm.AggType != "" && rpm.AggInterval != ""` appears character-identically in 4 files — readers/postgres/json.go, readers/postgres/senml.go, readers/timescale/json.go, readers/timescale/senml.go. 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.
Fat interface: AuthClient (20 methods) pkg/domain/auth.go:161— `AuthClient` declares 20 methods: `Issue`, `IssueImpersonated`, `RefreshToken`, `RevokeSessions`, `RevokeAPIKeys`, `Identify`, `IdentifyRecovery`, `Authorize`, `GetOwnerIDByOrg`, `AssignRole`, `RetrieveRole`, `RetrieveRoles`, `UnassignRole`, `CreateDormantOrgInvite`, `ActivateOrgInvite`, `GetDormantOrgInviteByPlatformInvite`, `ViewOrg`, `GetAdminsByOrg`, `GetOrgIDsByAdmin`, `GetOrgMembership`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ThingsClient (18 methods) pkg/domain/things.go:163— `ThingsClient` declares 18 methods: `GetPubConfigByKey`, `GetConfigByThing`, `CanUserAccessThing`, `CanUserAccessThings`, `CanUserAccessProfile`, `CanUserAccessGroup`, `CanThingAccessGroup`, `CanThingCommand`, `CanThingGroupCommand`, `Identify`, `GetGroupIDByThing`, `GetGroupIDByProfile`, `GetGroupIDsByOrg`, `GetThingIDsByProfile`, `CreateGroupMemberships`, `RemoveGroupMembershipsByOrg`, `GetGroup`, `GetKeyByThingID`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: SDK (85 methods) REDACTED:223— `SDK` declares 85 methods: `CreateUser`, `GetUser`, `ListUsers`, `CreateToken`, `RegisterUser`, `UpdateUser`, `UpdatePassword`, `CreateThing`, `CreateThings`, `ListThings`, `ListThingsByProfile`, `GetThing`, `GetThingMetadataByKey`, `UpdateThing`, `DeleteThing`, `DeleteThings`, `IdentifyThing`, `UpdateExternalThingKey`, `CreateGroup`, `DeleteGroup`, `DeleteGroups`, `ListGroups`, `ListGroupsByOrg`, `GetGroup`, `ListThingsByGroup`, `GetGroupByThing`, `UpdateGroup`, `CreateProfile`, `CreateProfiles`, `ListProfiles`, `GetProfileByThing`, `GetProfile`, `UpdateProfile`, `DeleteProfile`, `DeleteProfiles`, `ListProfilesByGroup`, `GetGroupByProfile`, `CreateGroupMemberships`, `UpdateGroupMemberships`, `RemoveGroupMemberships`, and 45 more. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Service (39 methods) things/service.go:45— `Service` declares 39 methods: `CreateThings`, `UpdateThing`, `UpdateThingGroupAndProfile`, `UpdateThingsMetadata`, `ViewThing`, `ListThings`, `ListThingsByOrg`, `ListThingsByProfile`, `RemoveThings`, `CreateProfiles`, `UpdateProfile`, `ViewProfile`, `ListProfiles`, `ListProfilesByOrg`, `ViewProfileByThing`, `ViewMetadataByKey`, `RemoveProfiles`, `GetPubConfigByKey`, `GetConfigByThing`, `CanUserAccessThing`, `CanUserAccessThings`, `CanUserAccessProfile`, `CanUserAccessGroup`, `CanThingAccessGroup`, `CanThingCommand`, `CanThingGroupCommand`, `Identify`, `GetKeyByThingID`, `GetGroupIDByThing`, `GetGroupIDByProfile`, `GetOrgIDByGroup`, `GetGroupIDsByOrg`, `UpdateExternalKey`, `RemoveExternalKey`, `Backup`, `Restore`, `GetThingIDsByProfile`, `GetThingIDsByGroup`, `GetGroupIDsByOrgInternal`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Service (18 methods) uiconfigs/service.go:24— `Service` declares 18 methods: `ViewOrgConfig`, `ListOrgsConfigs`, `UpdateOrgConfig`, `RemoveOrgConfig`, `BackupOrgsConfigs`, `ViewThingConfig`, `ListThingsConfigs`, `UpdateThingConfig`, `RemoveThingConfig`, `RemoveThingConfigByGroup`, `BackupThingsConfigs`, `ViewGroupConfig`, `ListGroupsConfigs`, `UpdateGroupConfig`, `RemoveGroupConfig`, `BackupGroupsConfigs`, `Backup`, `Restore`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Service (26 methods) users/service.go:68— `Service` declares 26 methods: `SelfRegister`, `VerifyEmail`, `RegisterByInvite`, `Register`, `RegisterAdmin`, `Login`, `RefreshToken`, `OAuthLogin`, `OAuthCallback`, `ViewUser`, `ViewProfile`, `ListUsers`, `ListUsersByIDs`, `ListUsersByEmails`, `UpdateUser`, `GenerateResetToken`, `ChangePassword`, `ResetPassword`, `SendPasswordReset`, `EnableUser`, `DisableUser`, `Impersonate`, `AssignAdminRole`, `UnassignAdminRole`, `Backup`, `Restore`. Counted over the exported method specs the interface itself declares, once per name; an embedded interface is a role it composes, judged on its own declaration, and is not counted here. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Anemic entity: RevokedCert certs/certs.go:26— `RevokedCert` is an aggregate/entity with 3 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: Command pkg/transformers/json/command.go:11— `Command` is an aggregate/entity with 6 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: Message pkg/transformers/json/message.go:13— `Message` is an aggregate/entity with 5 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Anemic entity: Message pkg/transformers/senml/message.go:4— `Message` is an aggregate/entity with 12 data propert(ies) but no state-changing behaviour (only data and queries) — the business logic lives in a service.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 7 significant file(s) lose their only recent owner: uiconfigs/api/metrics.go, uiconfigs/postgres/things.go, uiconfigs/postgres/orgs.go, uiconfigs/mocks/things.go, uiconfigs/api/http/backup/endpoint.go, uiconfigs/mocks/groups.go, uiconfigs/mocks/orgs.go. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: cmd/shadows/main.go, rules/api/http/rules/requests.go, pkg/messaging/mqtt/pubsub.go, consumers/alarms/mocks/alarms.go, pkg/messaging/subscriber.go, downlinks/payload.go, pkg/messaging/publisher.go. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: auth/postgres/roles.go, pkg/cron/cron.go, auth/tracing/roles.go. Pair on, review, or document these before any departure.
Silent fallback default on error consumers/notifiers/format.go:37— `FormatConditions` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error consumers/notifiers/smtp/format.go:197— `formatJSONValue` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/events/redis.go:91— `occurredAt` turns a non-nil `err` into `return time.Time{}` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. 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 `if` or in the doc comment, and the row stops firing.
README/code drift .github/workflows/README.md:22— .github/workflows/README.md names Go 1.25, but REDACTED:3 requires `go 1.26.0`: the code does not build on Go 1.25. 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 consumers/writers/README.md:10— consumers/writers/README.md links to `../REDACTED`, but `consumers/REDACTED` 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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (20 single-owned of 386 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; 386 of the 660 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: pkg/mproxy/session/session.go, certs/api/responses.go, auth/invites.go.
No ADRs found REDACTED:4— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 4).
D21 · Naming Consistency· `authHttpConfig` spells `Http` where 40 names in the project spell it `HTTP` · ×1
`authHttpConfig` spells `Http` where 40 names in the project spell it `HTTP` cmd/things/main.go:138— 40 of 41 names in project github.com/MainfluxLabs/mainflux spell the token `HTTP` (40 of 41; unit: names in project github.com/MainfluxLabs/mainflux containing `HTTP`). Peers: main.defHTTPPort (cmd/alarms/main.go:65); main.envHTTPPort (cmd/alarms/main.go:88); main.defHTTPPort (cmd/audit/main.go:55); main.envHTTPPort (cmd/audit/main.go:79); main.defHTTPPort (cmd/auth/main.go:60). Rename to `authHTTPConfig`. [rule N6]
D21 · Naming Consistency· `GetThingId` spells `Id` where 1654 names in the project spell it `ID` · ×1
`GetThingId` spells `Id` where 1654 names in the project spell it `ID` readers/api/grpc/server.go:68— 1654 of 1655 names in project github.com/MainfluxLabs/mainflux spell the token `ID` (1654 of 1655; unit: names in project github.com/MainfluxLabs/mainflux containing `ID`). Peers: listEventsByOrgReq.orgID (audit/api/http/requests.go:34); listEventsByGroupReq.groupID (audit/api/http/requests.go:52); eventRes.OrgID (audit/api/http/responses.go:29); eventRes.GroupID (audit/api/http/responses.go:30); loggingMiddleware.ListEventsByOrg(orgID) (audit/api/logging.go:43). Rename to `GetThingID`. [rule N6]
D21 · Naming Consistency· `OperatorAND` spells `AND` where 29 names in the project spell it `And` · ×1
`OperatorAND` spells `AND` where 29 names in the project spell it `And` rules/rules.go:64— 29 of 30 names in project github.com/MainfluxLabs/mainflux spell the token `And` (29 of 30; unit: names in project github.com/MainfluxLabs/mainflux containing `And`). Peers: CertScheduler.renewAndNotify (certs/scheduler.go:121); loggingMiddleware.LoadAndScheduleTasks (downlinks/api/logging.go:155); metricsMiddleware.LoadAndScheduleTasks (downlinks/api/metrics.go:117); Service.LoadAndScheduleTasks (downlinks/service.go:73); downlinksService.LoadAndScheduleTasks (downlinks/service.go:397). Rename to `OperatorAnd`. [rule N6]
D21 · Naming Consistency· `ErrInvalidUrl` spells `Url` where 193 names in the project spell it `URL` · ×1
`ErrInvalidUrl` spells `Url` where 193 names in the project spell it `URL` webhooks/api/http/requests.go:21— 193 of 194 names in project github.com/MainfluxLabs/mainflux spell the token `URL` (193 of 194; unit: names in project github.com/MainfluxLabs/mainflux containing `URL`). Peers: Config.CertsURL (certs/service.go:85); Config.JaegerURL (certs/service.go:86); Config.AuthURL (certs/service.go:87); cli.HTTPAdapterURL (cli/utils.go:34); main.defBrokerURL (cmd/alarms/main.go:52). Rename to `ErrInvalidURL`. [rule N6]
D27 · Navigability· High interface indirection · ×1
High interface indirection — 38 % of calls go through an interface — tracing a call means resolving the implementation each hop. Prefer concrete types where there's a single implementation.
Scattered collaborators — 73 % of calls cross a namespace and only 22 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 28 of 386 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 386 of the 660 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: cmd/audit/main.go, pkg/events/publisher.go, users/postgres/invites.go, REDACTED, tools/provision/provision.go, REDACTED, cmd/timescale-writer/main.go, auth/mocks/invites.go (and 20 more). 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.
D8 · Code Coverage· Tests reach code only in some runs · ×1
Tests reach code only in some runs: pkg/events/publisher.go pkg/events/publisher.go:218— 6 line(s) (218-220, 238-240) were executed in some of the 3 runs of the suite and not in others. A test that does not take the same path every run only tests the part it always takes, so these lines are not counted as covered. Make the tests that reach them deterministic (a fixed clock, seed or ordering, or waiting on the event instead of on time), or test the paths directly.
ED3 · Event naming· Event not named in past tense · ×1
Event not named in past tense: redisEvent pkg/events/redis.go:58— `redisEvent` reads as an instruction, not a fact that happened: events describe something that already occurred. Name new events for the fact that occurred (e.g. `OrderPlaced`). Do not rename this one if it is already stored or published: its type name is written with every event recorded under it, so a rename can break replay of the stored stream and every subscriber that reads it, and a clearer name does not pay for that. If it has never been written or sent, renaming it now is safe.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Benchmarks don't track allocations users/argon2/hasher_test.go— A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
Security headers incomplete REDACTED:36— Set: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy — 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. (−0.5 on this card.)
X2 · Cancellation propagation· Not all functions that make a request accept a context.Context · ×1
Not all functions that make a request accept a context.Context — Only 5/88 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Outdated: github.com/cenkalti/backoff/v4 — `github.com/cenkalti/backoff/v4` is required at v4.1.3 in REDACTED, but v4.3.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/cenkalti/backoff/v4@v4.3.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/docker/docker — `github.com/docker/docker` is required at v28.3.3+incompatible in REDACTED, but v28.5.2+incompatible is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/docker/docker@v28.5.2+incompatible && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/fatih/color — `github.com/fatih/color` is required at v1.13.0 in REDACTED, but v1.19.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/fatih/color@v1.19.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/gofrs/uuid — `github.com/gofrs/uuid` is required at v4.2.0+incompatible in REDACTED, but v4.4.0+incompatible is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/gofrs/uuid@v4.4.0+incompatible && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/jackc/pgx/v5 — `github.com/jackc/pgx/v5` is required at v5.10.0 in REDACTED, but v5.13.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jackc/pgx/v5@v5.13.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/jmoiron/sqlx — `github.com/jmoiron/sqlx` is required at v1.3.5 in REDACTED, but v1.4.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/jmoiron/sqlx@v1.4.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/nats-io/nats.go — `github.com/nats-io/nats.go` is required at v1.15.0 in REDACTED, but v1.55.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/nats-io/nats.go@v1.55.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/oklog/ulid/v2 — `github.com/oklog/ulid/v2` is required at v2.1.0 in REDACTED, but v2.1.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/oklog/ulid/v2@v2.1.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/ory/dockertest/v3 — `github.com/ory/dockertest/v3` is required at v3.9.1 in REDACTED, but v3.12.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/ory/dockertest/v3@v3.12.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/plgd-dev/go-coap/v3 — `github.com/plgd-dev/go-coap/v3` is required at v3.6.0 in REDACTED, but v3.8.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/plgd-dev/go-coap/v3@v3.8.1 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/prometheus/client_golang — `github.com/prometheus/client_golang` is required at v1.11.1 in REDACTED, but v1.25.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/prometheus/client_golang@v1.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/rubenv/sql-migrate — `github.com/rubenv/sql-migrate` is required at v1.1.2 in REDACTED, but v1.8.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/rubenv/sql-migrate@v1.8.1 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/spf13/cobra — `github.com/spf13/cobra` is required at v1.5.0 in REDACTED, but v1.10.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/spf13/cobra@v1.10.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/spf13/viper — `github.com/spf13/viper` is required at v1.12.0 in REDACTED, but v1.21.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/spf13/viper@v1.21.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/subosito/gotenv — `github.com/subosito/gotenv` is required at v1.4.0 in REDACTED, but v1.6.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/subosito/gotenv@v1.6.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/crypto — `golang.org/x/crypto` is required at v0.58.0 in REDACTED, but v0.59.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/crypto@v0.59.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/oauth2 — `golang.org/x/oauth2` is required at v0.35.0 in REDACTED, but v0.38.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/oauth2@v0.38.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/sync — `golang.org/x/sync` is required at v0.24.0 in REDACTED, but v0.25.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sync@v0.25.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/text — `golang.org/x/text` is required at v0.43.0 in REDACTED, but v0.44.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/text@v0.44.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/time — `golang.org/x/time` is required at v0.14.0 in REDACTED, but v0.16.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/time@v0.16.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: gonum.org/v1/gonum — `gonum.org/v1/gonum` is required at v0.11.0 in REDACTED, but v0.17.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get gonum.org/v1/gonum@v0.17.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: google.golang.org/grpc — `google.golang.org/grpc` is required at v1.64.1 in REDACTED, but v1.85.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/grpc@v1.85.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: google.golang.org/protobuf — `google.golang.org/protobuf` is required at v1.34.2 in REDACTED, but v1.36.12 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get google.golang.org/protobuf@v1.36.12 && go mod tidy` and commit the updated REDACTED and go.sum.
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 1 file(s) — `modbus/codec.go` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1e7ff-bdab-7b41-b48b-6938dbb728ac · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 51 · Warnings: 1316 · Recommendations: 197 · Info: 23 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 05:34 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.