Public report of Azure/azure-container-networking, published 16 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, 16 November 2026, 12:41 UTC · Survey ID cd_3cffb0e2077b486f92a4b9095582cf42
Azure/azure-container-networking
Measured 16 November 2026, 12:40 UTC, at code version 2c74ec0
First survey, so nothing to compare with yet
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
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: 79,603 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 1.7 person-years · Weakest lens: Production Readiness, 57.9
Findings by how serious they are
71 critical1573 serious325 minor
17 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
16 November 2026, 12:40 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
61of 61 dimensions measured by tools.
1936of 1969 findings point to an exact file and line, so you can open each one in the code. The other 33 concern the repository as a whole, such as missing documentation.
61dimensions across 6 lenses, read from 79,603 lines of product code in 12 projects.
Azure/azure-container-networking falls short of our standard for production, held back most by its Production Readiness lens, the way the code is tested, built, released and run. It scores 64.1 out of 100 and is rated Adequate, and 61 of its 71 critical findings are security problems in its servers and containers.
Production Readiness, at 57.9, is the weakest lens and counts most in the score. The best first step is replacing the two deprecated dependencies, worth about 4.6 points. Protecting outgoing calls with timeouts would lift Production Readiness itself, worth about 4.0 points. Raising Production Readiness to 70 would lift the score to about 68.5.
Sixty-one settings leave the servers or containers unsafe. Ten parts of the code are no longer understood by anyone working on it. Correcting the unsafe settings and having someone learn the forgotten files would close both risks.
The product code is 79,603 lines, about €240,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Production Readiness rose from 57.9 to 70, the lowest score rated Strong, the score would rise from 64.1 to about 68.5.
Code composition: what the lines of code are
Product code 46%Tests 54%
Rebuild cost: about €240,000 · Estimate
Cost to rebuild
€81,000 to €400,000, for 1,342 to 4,259 hours of work, about 1.7 person-years for 1 to 4 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.9 at a score of 64. 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: 79,603 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Deprecated module finding(s) in Dependency Hygiene.
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.
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
One file is changed often and is hard to read, which makes it the likeliest place for a mistake. It also has under half its code tested, or was 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 this file therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (5 files) · Code Coverage (4 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: REDACTED
What to do: Add tests to these files and have a second person review every change to them, starting with REDACTED.
Where the investment is most exposed · Value at risk
This code would cost about €240,000 to build again, about 1.7 person-years of work. Its weakest lens is Production Readiness, at 57.9 (Adequate). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 2 Deprecated module finding(s) in Dependency Hygiene. Of all the actions in this report, it raises the score most for the work it takes: about 4.6 points for low effort, because it clears the 2 Dependency Hygiene findings. 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 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 30,358 lines over the last 90 days, which is about 123,119 lines a year. At that pace, the extra work comes to an estimated 16.9 to 101.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of 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.
177 modules, with 279 dependencies between them. 3 loops run through 18 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 137 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/Azure/azure-container-networking/common uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/common, while a change to com/Azure/azure-container-networking/common can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/common uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network/snat uses com/Azure/azure-container-networking/platform, so a change to com/Azure/azure-container-networking/platform can break com/Azure/azure-container-networking/network/snat, while a change to com/Azure/azure-container-networking/network/snat can't break com/Azure/azure-container-networking/platform.
Position
Below the diagonal: com/Azure/azure-container-networking/network/snat uses a module listed above it, which is the healthy direction.
12→28 com/Azure/azure-container-networking/nmagent uses com/Azure/azure-container-networking/cns/restserverpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/nmagent uses a type in com/Azure/azure-container-networking/cns/restserver.
com/Azure/azure-container-networking/nmagent uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/nmagent, while a change to com/Azure/azure-container-networking/nmagent can't break com/Azure/azure-container-networking/cns/restserver.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17 pairs of types, where a type in com/Azure/azure-container-networking/tools/failure-agent uses a type in com/Azure/azure-container-networking/tools/failure-agent/internal/model.
com/Azure/azure-container-networking/tools/failure-agent uses com/Azure/azure-container-networking/tools/failure-agent/internal/model, so a change to com/Azure/azure-container-networking/tools/failure-agent/internal/model can break com/Azure/azure-container-networking/tools/failure-agent, while a change to com/Azure/azure-container-networking/tools/failure-agent can't break com/Azure/azure-container-networking/tools/failure-agent/internal/model.
Position
Below the diagonal: com/Azure/azure-container-networking/tools/failure-agent uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/aitelemetry uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/aitelemetry, while a change to com/Azure/azure-container-networking/aitelemetry can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/aitelemetry uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/common uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/cns/common, while a change to com/Azure/azure-container-networking/cns/common can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/common uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/common uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cns/common, while a change to com/Azure/azure-container-networking/cns/common can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/common uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/iptables uses com/Azure/azure-container-networking/platform, so a change to com/Azure/azure-container-networking/platform can break com/Azure/azure-container-networking/iptables, while a change to com/Azure/azure-container-networking/iptables can't break com/Azure/azure-container-networking/platform.
Position
Below the diagonal: com/Azure/azure-container-networking/iptables uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/iptables uses com/Azure/azure-container-networking/network/snat, so a change to com/Azure/azure-container-networking/network/snat can break com/Azure/azure-container-networking/iptables, while a change to com/Azure/azure-container-networking/iptables can't break com/Azure/azure-container-networking/network/snat.
Position
Below the diagonal: com/Azure/azure-container-networking/iptables uses a module listed above it, which is the healthy direction.
16→37 com/Azure/azure-container-networking/iptables uses com/Azure/azure-container-networking/networkpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/iptables uses a type in com/Azure/azure-container-networking/network.
com/Azure/azure-container-networking/iptables uses com/Azure/azure-container-networking/network, so a change to com/Azure/azure-container-networking/network can break com/Azure/azure-container-networking/iptables, while a change to com/Azure/azure-container-networking/iptables can't break com/Azure/azure-container-networking/network.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets uses a type in com/Azure/azure-container-networking/common.
com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns uses a type in com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1, so a change to com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1 can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in com/Azure/azure-container-networking/cns uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/network/policy, so a change to com/Azure/azure-container-networking/network/policy can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/network/policy.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns uses com/Azure/azure-container-networking/cns/common, so a change to com/Azure/azure-container-networking/cns/common can break com/Azure/azure-container-networking/cns, while a change to com/Azure/azure-container-networking/cns can't break com/Azure/azure-container-networking/cns/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/logger/v2 uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/logger/v2, while a change to com/Azure/azure-container-networking/cns/logger/v2 can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/logger/v2 uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/logger/v2 uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cns/logger/v2, while a change to com/Azure/azure-container-networking/cns/logger/v2 can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/logger/v2 uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/logger/v2 uses com/Azure/azure-container-networking/aitelemetry, so a change to com/Azure/azure-container-networking/aitelemetry can break com/Azure/azure-container-networking/cns/logger/v2, while a change to com/Azure/azure-container-networking/cns/logger/v2 can't break com/Azure/azure-container-networking/aitelemetry.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/logger/v2 uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses a type in com/Azure/azure-container-networking/common.
com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/npm/pkg/dataplane/policies, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/policies can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/dataplane/policies, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/policies can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/policies uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/telemetry uses com/Azure/azure-container-networking/platform, so a change to com/Azure/azure-container-networking/platform can break com/Azure/azure-container-networking/telemetry, while a change to com/Azure/azure-container-networking/telemetry can't break com/Azure/azure-container-networking/platform.
Position
Below the diagonal: com/Azure/azure-container-networking/telemetry uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/telemetry uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/telemetry, while a change to com/Azure/azure-container-networking/telemetry can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/telemetry uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/telemetry uses com/Azure/azure-container-networking/aitelemetry, so a change to com/Azure/azure-container-networking/aitelemetry can break com/Azure/azure-container-networking/telemetry, while a change to com/Azure/azure-container-networking/telemetry can't break com/Azure/azure-container-networking/aitelemetry.
Position
Below the diagonal: com/Azure/azure-container-networking/telemetry uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com/Azure/azure-container-networking/cns/ipampool/v2 uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/ipampool/v2 uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/ipampool/v2, while a change to com/Azure/azure-container-networking/cns/ipampool/v2 can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/ipampool/v2 uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/ipampool/v2 uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/ipampool/v2, while a change to com/Azure/azure-container-networking/cns/ipampool/v2 can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/ipampool/v2 uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a type in com/Azure/azure-container-networking/cns/types.
com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig, while a change to com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a module listed above it, which is the healthy direction.
5 pairs of types, where a type in com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig, while a change to com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a type in com/Azure/azure-container-networking/cns.
com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig, while a change to com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a module listed above it, which is the healthy direction.
23→28 com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses com/Azure/azure-container-networking/cns/restserverpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses a type in com/Azure/azure-container-networking/cns/restserver.
com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig, while a change to com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig can't break com/Azure/azure-container-networking/cns/restserver.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses a type in com/Azure/azure-container-networking/cns/types.
com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator, while a change to com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses a module listed above it, which is the healthy direction.
6 pairs of types, where a type in com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses a type in com/Azure/azure-container-networking/cns.
com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator, while a change to com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses a module listed above it, which is the healthy direction.
24→28 com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses com/Azure/azure-container-networking/cns/restserverpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses a type in com/Azure/azure-container-networking/cns/restserver.
com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator, while a change to com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator can't break com/Azure/azure-container-networking/cns/restserver.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
com/Azure/azure-container-networking/cns/nodesubnet uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/nodesubnet, while a change to com/Azure/azure-container-networking/cns/nodesubnet can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/nodesubnet uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/nodesubnet uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/nodesubnet uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/nodesubnet, while a change to com/Azure/azure-container-networking/cns/nodesubnet can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/nodesubnet uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/nodesubnet uses com/Azure/azure-container-networking/nmagent, so a change to com/Azure/azure-container-networking/nmagent can break com/Azure/azure-container-networking/cns/nodesubnet, while a change to com/Azure/azure-container-networking/cns/nodesubnet can't break com/Azure/azure-container-networking/nmagent.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/nodesubnet uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/nodesubnet uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/nodesubnet, while a change to com/Azure/azure-container-networking/cns/nodesubnet can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/nodesubnet uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/wireserver uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/wireserver, while a change to com/Azure/azure-container-networking/cns/wireserver can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/wireserver uses a module listed above it, which is the healthy direction.
26→28 com/Azure/azure-container-networking/cns/wireserver uses com/Azure/azure-container-networking/cns/restserverpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/cns/wireserver uses a type in com/Azure/azure-container-networking/cns/restserver.
com/Azure/azure-container-networking/cns/wireserver uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/wireserver, while a change to com/Azure/azure-container-networking/cns/wireserver can't break com/Azure/azure-container-networking/cns/restserver.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
com/Azure/azure-container-networking/npm/pkg/dataplane uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/npm/pkg/dataplane, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane uses a module listed above it, which is the healthy direction.
8 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/dataplane uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/dataplane, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
com/Azure/azure-container-networking/npm/pkg/dataplane uses com/Azure/azure-container-networking/npm/pkg/dataplane/policies, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/policies can break com/Azure/azure-container-networking/npm/pkg/dataplane, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane can't break com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1, so a change to com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1 can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/nmagent, so a change to com/Azure/azure-container-networking/nmagent can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/nmagent.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/common, so a change to com/Azure/azure-container-networking/cns/common can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
45 pairs of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns/ipampool/v2.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/ipampool/v2, so a change to com/Azure/azure-container-networking/cns/ipampool/v2 can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/ipampool/v2.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig, so a change to com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/kubecontroller/nodenetworkconfig.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator, so a change to com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/multitenantcontroller/multitenantoperator.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns/nodesubnet.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/nodesubnet, so a change to com/Azure/azure-container-networking/cns/nodesubnet can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/nodesubnet.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/Azure/azure-container-networking/cns/restserver uses a type in com/Azure/azure-container-networking/cns/wireserver.
com/Azure/azure-container-networking/cns/restserver uses com/Azure/azure-container-networking/cns/wireserver, so a change to com/Azure/azure-container-networking/cns/wireserver can break com/Azure/azure-container-networking/cns/restserver, while a change to com/Azure/azure-container-networking/cns/restserver can't break com/Azure/azure-container-networking/cns/wireserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/restserver uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/controlplane uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/controlplane, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
com/Azure/azure-container-networking/npm/pkg/controlplane uses com/Azure/azure-container-networking/npm/pkg/dataplane/policies, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/policies can break com/Azure/azure-container-networking/npm/pkg/controlplane, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane can't break com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane.
com/Azure/azure-container-networking/npm/pkg/controlplane uses com/Azure/azure-container-networking/npm/pkg/dataplane, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane can break com/Azure/azure-container-networking/npm/pkg/controlplane, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane can't break com/Azure/azure-container-networking/npm/pkg/dataplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane.
com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses com/Azure/azure-container-networking/npm/pkg/dataplane, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane can break com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 can't break com/Azure/azure-container-networking/npm/pkg/dataplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane/controllers/v2 uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/client, while a change to com/Azure/azure-container-networking/cns/client can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/client uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/client, while a change to com/Azure/azure-container-networking/cns/client can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/client uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/client, while a change to com/Azure/azure-container-networking/cns/client can't break com/Azure/azure-container-networking/cns/restserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/client uses a module listed above it, which is the healthy direction.
31→37 com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/networkpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/cns/client uses a type in com/Azure/azure-container-networking/network.
com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/network, so a change to com/Azure/azure-container-networking/network can break com/Azure/azure-container-networking/cns/client, while a change to com/Azure/azure-container-networking/cns/client can't break com/Azure/azure-container-networking/network.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
31→38 com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/cni/networkpart of a loop✕
Connections
1 pair of types, where a type in com/Azure/azure-container-networking/cns/client uses a type in com/Azure/azure-container-networking/cni/network.
com/Azure/azure-container-networking/cns/client uses com/Azure/azure-container-networking/cni/network, so a change to com/Azure/azure-container-networking/cni/network can break com/Azure/azure-container-networking/cns/client, while a change to com/Azure/azure-container-networking/cns/client can't break com/Azure/azure-container-networking/cni/network.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in com/Azure/azure-container-networking/cns/fakes uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/nmagent, so a change to com/Azure/azure-container-networking/nmagent can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/nmagent.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns/common, so a change to com/Azure/azure-container-networking/cns/common can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns/ipampool/v2, so a change to com/Azure/azure-container-networking/cns/ipampool/v2 can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns/ipampool/v2.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns/wireserver, so a change to com/Azure/azure-container-networking/cns/wireserver can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns/wireserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/fakes uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/fakes, while a change to com/Azure/azure-container-networking/cns/fakes can't break com/Azure/azure-container-networking/cns/restserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/fakes uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/middlewares uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/middlewares, while a change to com/Azure/azure-container-networking/cns/middlewares can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/middlewares uses a module listed above it, which is the healthy direction.
3 pairs of types, where a type in com/Azure/azure-container-networking/cns/middlewares uses a type in com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
com/Azure/azure-container-networking/cns/middlewares uses com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1, so a change to com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1 can break com/Azure/azure-container-networking/cns/middlewares, while a change to com/Azure/azure-container-networking/cns/middlewares can't break com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/middlewares uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/middlewares uses a type in com/Azure/azure-container-networking/network/policy.
com/Azure/azure-container-networking/cns/middlewares uses com/Azure/azure-container-networking/network/policy, so a change to com/Azure/azure-container-networking/network/policy can break com/Azure/azure-container-networking/cns/middlewares, while a change to com/Azure/azure-container-networking/cns/middlewares can't break com/Azure/azure-container-networking/network/policy.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/middlewares uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/middlewares uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/middlewares, while a change to com/Azure/azure-container-networking/cns/middlewares can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/middlewares uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/middlewares uses a type in com/Azure/azure-container-networking/cns/restserver.
com/Azure/azure-container-networking/cns/middlewares uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/middlewares, while a change to com/Azure/azure-container-networking/cns/middlewares can't break com/Azure/azure-container-networking/cns/restserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/middlewares uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/cns/types, so a change to com/Azure/azure-container-networking/cns/types can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/cns/types.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/cns/service uses a type in com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1, so a change to com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1 can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/crd/multitenancy/api/v1alpha1.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/cns/service uses a type in com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha, so a change to com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/crd/nodenetworkconfig/api/v1alpha.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/nmagent, so a change to com/Azure/azure-container-networking/nmagent can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/nmagent.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cns/service uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/cns/service, while a change to com/Azure/azure-container-networking/cns/service can't break com/Azure/azure-container-networking/cns/restserver.
Position
Below the diagonal: com/Azure/azure-container-networking/cns/service uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane.
com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses com/Azure/azure-container-networking/npm/pkg/dataplane, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane can break com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor can't break com/Azure/azure-container-networking/npm/pkg/dataplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a type in com/Azure/azure-container-networking/npm/pkg/controlplane.
com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses com/Azure/azure-container-networking/npm/pkg/controlplane, so a change to com/Azure/azure-container-networking/npm/pkg/controlplane can break com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor, while a change to com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor can't break com/Azure/azure-container-networking/npm/pkg/controlplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/controlplane/goalstateprocessor uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets can break com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim can't break com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses com/Azure/azure-container-networking/npm/pkg/dataplane/policies, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane/policies can break com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim can't break com/Azure/azure-container-networking/npm/pkg/dataplane/policies.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a module listed above it, which is the healthy direction.
2 pairs of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a type in com/Azure/azure-container-networking/npm/pkg/dataplane.
com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses com/Azure/azure-container-networking/npm/pkg/dataplane, so a change to com/Azure/azure-container-networking/npm/pkg/dataplane can break com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim can't break com/Azure/azure-container-networking/npm/pkg/dataplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a type in com/Azure/azure-container-networking/npm/pkg/controlplane.
com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses com/Azure/azure-container-networking/npm/pkg/controlplane, so a change to com/Azure/azure-container-networking/npm/pkg/controlplane can break com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim, while a change to com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim can't break com/Azure/azure-container-networking/npm/pkg/controlplane.
Position
Below the diagonal: com/Azure/azure-container-networking/npm/pkg/dataplane/dpshim uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/network/policy, so a change to com/Azure/azure-container-networking/network/policy can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/network/policy.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/platform, so a change to com/Azure/azure-container-networking/platform can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/platform.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/store, so a change to com/Azure/azure-container-networking/store can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/store.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/network/snat, so a change to com/Azure/azure-container-networking/network/snat can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/network/snat.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/iptables, so a change to com/Azure/azure-container-networking/iptables can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/iptables.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/cns/restserver, so a change to com/Azure/azure-container-networking/cns/restserver can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/cns/restserver.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/network uses com/Azure/azure-container-networking/cns/client, so a change to com/Azure/azure-container-networking/cns/client can break com/Azure/azure-container-networking/network, while a change to com/Azure/azure-container-networking/network can't break com/Azure/azure-container-networking/cns/client.
Position
Below the diagonal: com/Azure/azure-container-networking/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/network/policy, so a change to com/Azure/azure-container-networking/network/policy can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/network/policy.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/cns, so a change to com/Azure/azure-container-networking/cns can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/cns.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/telemetry, so a change to com/Azure/azure-container-networking/telemetry can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/telemetry.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/network uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/network, so a change to com/Azure/azure-container-networking/network can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/network.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/network uses a module listed above it, which is the healthy direction.
38→39 com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/cnipart of a loop✕
Connections
14 pairs of types, where a type in com/Azure/azure-container-networking/cni/network uses a type in com/Azure/azure-container-networking/cni.
com/Azure/azure-container-networking/cni/network uses com/Azure/azure-container-networking/cni, so a change to com/Azure/azure-container-networking/cni can break com/Azure/azure-container-networking/cni/network, while a change to com/Azure/azure-container-networking/cni/network can't break com/Azure/azure-container-networking/cni.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
com/Azure/azure-container-networking/cni uses com/Azure/azure-container-networking/network/policy, so a change to com/Azure/azure-container-networking/network/policy can break com/Azure/azure-container-networking/cni, while a change to com/Azure/azure-container-networking/cni can't break com/Azure/azure-container-networking/network/policy.
Position
Below the diagonal: com/Azure/azure-container-networking/cni uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cni, while a change to com/Azure/azure-container-networking/cni can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cni uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni uses com/Azure/azure-container-networking/cni/network, so a change to com/Azure/azure-container-networking/cni/network can break com/Azure/azure-container-networking/cni, while a change to com/Azure/azure-container-networking/cni can't break com/Azure/azure-container-networking/cni/network.
Position
Below the diagonal: com/Azure/azure-container-networking/cni uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/ipam uses com/Azure/azure-container-networking/common, so a change to com/Azure/azure-container-networking/common can break com/Azure/azure-container-networking/cni/ipam, while a change to com/Azure/azure-container-networking/cni/ipam can't break com/Azure/azure-container-networking/common.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/ipam uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/ipam uses com/Azure/azure-container-networking/cni/network, so a change to com/Azure/azure-container-networking/cni/network can break com/Azure/azure-container-networking/cni/ipam, while a change to com/Azure/azure-container-networking/cni/ipam can't break com/Azure/azure-container-networking/cni/network.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/ipam uses a module listed above it, which is the healthy direction.
com/Azure/azure-container-networking/cni/ipam uses com/Azure/azure-container-networking/cni, so a change to com/Azure/azure-container-networking/cni can break com/Azure/azure-container-networking/cni/ipam, while a change to com/Azure/azure-container-networking/cni/ipam can't break com/Azure/azure-container-networking/cni.
Position
Below the diagonal: com/Azure/azure-container-networking/cni/ipam uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 70.3 · Adequate · gated by D2 ·
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
A02:2025 — Security Misconfiguration
674
High / Critical
A05:2025 — Injection
49
Medium
A03:2025 — Software Supply Chain Failures
25
Medium
Roadmap
Top priorities: Resolve the 2 Deprecated module finding(s) in Dependency Hygiene; 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; Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Deprecated module finding(s) in Dependency Hygiene.
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.
Per-file score 0–10 — a quality signature. Of 304 files carrying findings, judged against the Production bar: 6% slop · 57% mixed · 37% near-clean.
File
Score
Band
Worst signal
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.0
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.2
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.4
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.4
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.6
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.8
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
How the grades work
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 — 71
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 — 1573
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 — 325
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 17
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 61 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 — 61 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, 1936 of 1969 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.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
AXB2 Runtime readiness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The image build failed, and its output does not match a cause we recognise. (rule: unrecognised-build-failure). The renderer reported: docker build failed (exit 1) — 7 | 8 | # mcr.microsoft.com/azurelinux/base/core:3.0 -------------------- ERROR: failed to solve: failed to parse platform linux/${ARCH}: "" is an invalid component of "linux/": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument; likely cause (not identified): the image build failed, and its output does not match a cause we recognise; runtime evidence skipped.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — 7 | 8 | # mcr.microsoft.com/azurelinux/base/core:3.0 -------------------- ERROR: failed to solve: failed to parse platform linux/${ARCH}: "" is an invalid component of "linux/": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument; likely cause (not identified): the image build failed, and its output does not match a cause we recognise; runtime evidence skipped.
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.
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 no C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Java was found, and this repository's Go, Python, c 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 no C#, JavaScript/TypeScript, Java, Dart, Ruby, Scala or Rust was found, and this repository's Go, Python, c 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.
S1 Web-Security Posture — 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 web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
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.
X13 Undrained process stream — 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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala, Kotlin or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala, PHP or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript (Vue and Svelte components included), Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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. 109 further occurrence(s) are not listed individually; the score already reflects all 149.
X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, Kotlin source, and Rust source only, and no C# was loaded, no TypeScript was found, and this repository's C, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
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.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D42 Runtime Threat Enforcement: Runtime enforcement is read from committed policy files — a Tetragon/Falco/Kyverno stack installed cluster-wide (Helm release, platform add-on) with no in-repo trace can't be credited, and a committed policy is declared intent, not proof the engine is running and blocking in the live cluster.
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.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: 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.
55 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was main.main at 104. A further 1 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 ResponseCode.String at 40 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: cns/types/codes.go (ResponseCode.String at 40). 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.
+ 50 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with main.main (cyclomatic 104), controllers.translateIngress (cyclomatic 67), controllers.translateEgress (cyclomatic 67). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 6.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: 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.
+ 150 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 60 down to 60 or less in Cognitive Complexity — start with controllers.translateEgress (cognitive 222), controllers.translateIngress (cognitive 220), main.main (cognitive 158). — 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 6 together lifts Cognitive Complexity from 2.1 to about 5.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 FileTooLong finding(s) in God Classes — start with translatePolicy.go, REDACTED, ipam.go. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 7 TooManyMethods finding(s) in God Classes — start with restserver.go, manager.go, ipsetmanager.go. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 FunctionTooLong finding(s) in God Classes — start with translatePolicy.go (2), REDACTED (2), mockClient.go. — One of this dimension's main actionable groups (6 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.
191 duplicated block group(s) detected. 11.6 % of the production lines (9,221 of 79,603) are in a reported copy. A further 129 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 14 of the 320 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 128 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with client.go (2), api.go (2), REDACTED (2). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 12 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with client.go (2), proxy.go (2), REDACTED. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 12 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with ipam.go (3), conversion_linux.go, api.go. — One of this dimension's main actionable groups (12 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
12 production modules (Go), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 10 of the 12 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with restserver.go, wireserverproxyfake.go, networkutils_linux.go. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
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 71.1% — 4 file(s) below 50%. Measured from the Go suite (github.com/Azure/azure-container-networking: no cover profile; github.com/Azure/azure-container-networking/azure-ip-masq-merger: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/Azure/azure-container-networking/azure-ipam: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/Azure/azure-container-networking/azure-iptables-monitor: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/Azure/azure-container-networking/cilium-log-collector: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/Azure/azure-container-networking/pkgerrlint: no cover profile; azure-npm-to-cilium-validator: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/Azure/azure-container-networking/tools/failure-agent: `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.
Resolve the 4 Low coverage finding(s) in Code Coverage — start with REDACTED, interfaces.go, azure-npm-to-cilium-validator.go. — One of this dimension's main actionable groups (4 warning-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.
16 outdated, 2 author-deprecated direct Go module(s), 1 pinning or checksum defect(s). 114 of 114 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 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.
Resolve the 2 Deprecated module finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Dependency pinned to a stale untagged commit 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.
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 230 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 5 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), REDACTED, translatePolicy.go. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with parseSelector.go. — One of this dimension's main actionable groups (1 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.3 / 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.
19 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is tools/failure-agent/internal/classify/llm.go. Counted over 266 of the 529 production source files in this repository: 257 are under the ~2,400-byte size floor this dimension measures over, and the remaining 6 have no attributable history left to measure.
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.
356 deducted task-comment markers across 79603 LoC (0.4/KLoC) → score 9.1. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 348 TodoComment finding(s) in Explicit Debt — start with dataplane.go (27), podController.go (25), ipsetmanager_linux.go (20). — One of this dimension's main actionable groups (348 warning-level).
Resolve the 7 FixmeComment finding(s) in Explicit Debt — start with policymanager_windows.go (3), ipsetmanager_windows_test.go (2), network_windows.go. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 HackComment finding(s) in Explicit Debt — start with policymanager_linux_test.go. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 50 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.
19 naming inconsistencies among 930 declarations measured against a convention their peers follow.
`PodIpInfo` spells `Ip` where 528 names in the project spell it `IP` · ×2cns/NetworkContainerContract.go:525
`HostIp` spells `Ip` where 528 names in the project spell it `IP`cni/netconfig.go:28
`virtualGW` spells `GW` where 12 names in the project spell it `Gw`cns/middlewares/k8sSwiftV2.go:24
`getSwiftV2IpConfigHelper` spells `Ip` where 528 names in the project spell it `IP`cns/middlewares/k8sSwiftV2.go:101
`programSNATRules` spells `SNAT` where 82 names in the project spell it `Snat`cns/restserver/internalapi_linux.go:38
+ 13 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 `PodIpInfo` spells `Ip` where 528 names in the project spell it `IP` finding(s) in Naming Consistency — start with NetworkContainerContract.go (2). — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 `HostIp` spells `Ip` where 528 names in the project spell it `IP` finding(s) in Naming Consistency — start with netconfig.go. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `virtualGW` spells `GW` where 12 names in the project spell it `Gw` finding(s) in Naming Consistency — start with k8sSwiftV2.go. — One of this dimension's main actionable groups (1 recommendation-level).
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.3 / 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 406 exposed members measured against a convention their peers follow.
`HTTPService.GetPodIPConfigState` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`)cns/api.go:54
`Server.ListAndWatch` takes no context.Context; its 6 sibling operations take oneREDACTED:118
`metrics.GetHandler` signals absence with a bare `T` (the zero value when absent) where its 5 sibling single-key reads use `(T, error)` (an error when absent)npm/metrics/prometheus-metrics.go:360
What to do
Resolve the 1 `HTTPService.GetPodIPConfigState` returns a map (`map[K]V`) where its 4… finding(s) in Internal API Consistency — start with api.go. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `Server.ListAndWatch` takes no context.Context; its 6 sibling operations… finding(s) in Internal API Consistency — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 `metrics.GetHandler` signals absence with a bare `T` (the zero value… finding(s) in Internal API Consistency — start with prometheus-metrics.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.
1 of 12 build units (Go) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionREDACTED:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability7.5 / 10Strong✓ 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.
48 % of calls cross a namespace and 23 % go through an interface, but 45 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.
Scattered collaborators
What to do
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: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
50 finding(s): 0 critical, 0 high, 42 medium, 8 low. semgrep hit a parse error in 7 file(s) — `.pipelines/failure-agent-teams-bot/scripts/notify-bot.sh` (line 187, line 188, line 193, …), `.pipelines/swiftv2-long-running/scripts/acquire_pipeline_lease.sh` (line 59), `cni/scripts/gen-transparent-tunnel-conflist.sh` (line 13, line 14), `cns/kubeconfigtemplate.yaml`, `hack/scripts/collect-windows-logs.sh` (line 134), … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 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
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. 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 19 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (19). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 2 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 504 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (51), REDACTED (51), REDACTED (44). — One of this dimension's main actionable groups (504 warning-level).
Resolve the 61 High IaC finding(s) in IaC & Container Security — start with REDACTED (9), REDACTED (6), REDACTED (5). — One of this dimension's main actionable groups (61 issue-level).
Resolve the 109 Low IaC finding(s) in IaC & Container Security — start with REDACTED (16), REDACTED (16), REDACTED (6). — One of this dimension's main actionable groups (109 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
114 of 272 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is npm/pkg/controlplane/controllers/v1/translatePolicy.go. Counted over 272 of the 529 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 104 Orphaned file finding(s) in Knowledge Freshness — start with client.go (3), types.go (3), plugin.go (2). — One of this dimension's main actionable groups (104 recommendation-level).
Resolve the 10 Orphaned knowledge finding(s) in Knowledge Freshness — start with translatePolicy.go, ipsetmanager_linux.go, dataplane.go. — One of this dimension's main actionable groups (10 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 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 the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
1 egress rule(s) allow every address on every port, so egress is not restricted for the workloads they select.
Egress open to every addressnpm/testpolicies/allow-all-from-app-backend.yaml:13
What to do
Resolve the 1 Egress open to every address finding(s) in Network Egress Confinement — start with allow-all-from-app-backend.yaml. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d40_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
0/26 workload(s) run every container under a seccomp profile; 0/26 declare an AppArmor/SELinux profile.
No seccomp profile · ×26REDACTED:10
What to do
Resolve the 26 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED (4), REDACTED (3), REDACTED (3). — One of this dimension's main actionable groups (26 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the Kubernetes deployment wires runtime threat enforcement — a detection engine (Tetragon/Falco) and/or an admission-control policy gate (Kyverno / OPA Gatekeeper / PodSecurity). Presence of committed policy, not a runtime guarantee.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a runtime threat-detection engine (Tetragon TracingPolicy / Falco) and an admission-control policy (Kyverno / OPA Gatekeeper / PodSecurity). Reward-leaning; NotApplicable without workloads. Deterministic.
Resolve the 1 No runtime threat detection finding(s) in Runtime Threat Enforcement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d42_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 12 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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
`Server` serves requests (gRPC service methods run on a goroutine per request, and every one shares the single `Server` value the router holds) but writes its fields outside any lock (shutdownCh; e.g. `shutdownCh` in `Run` at line 50). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process. — REDACTED:23
What to do
Go: guard the state handlers share with a sync.Mutex held for the whole update (`mu.Lock(); defer mu.Unlock()`), make counters sync/atomic types (atomic.Int64) and caches a sync.Map, or keep per-request data in locals and the request context. `go test -race` over a handler test confirms the race and then its fix.
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 the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. 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.
`NetlinkInterface` declares 17 methods: `AddLink`, `DeleteLink`, `SetLinkName`, `SetLinkState`, `SetLinkMTU`, `SetLinkMaster`, `SetLinkNetNs`, `SetLinkNetNsByIndex`, `SetLinkAddress`, `SetLinkPromisc`, `SetLinkHairpin`, `SetOrRemoveLinkAddress`, `AddIPAddress`, `DeleteIPAddress`, `GetIPRoute`, `AddIPRoute`, `DeleteIPRoute`. 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. — netlink/netlinkinterface.go:10
`NetworkManager` declares 25 methods: `Initialize`, `Uninitialize`, `AddExternalInterface`, `CreateNetwork`, `DeleteNetwork`, `GetNetworkInfo`, `FindNetworkIDFromNetNs`, `GetNumEndpointsByContainerID`, `CreateEndpoint`, `EndpointCreate`, `DeleteEndpoint`, `GetEndpointInfo`, `GetAllEndpoints`, `GetEndpointInfoBasedOnPODDetails`, `AttachEndpoint`, `DetachEndpoint`, `UpdateEndpoint`, `GetNumberOfEndpoints`, `GetEndpointID`, `IsStatelessCNIMode`, `SaveState`, `DeleteState`, `GetEndpointInfosFromContainerID`, `GetEndpointState`, `GetEndpointIDByNicType`. 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. — network/manager.go:102
`GenericDataplane` declares 16 methods: `BootupDataplane`, `FinishBootupPhase`, `RunPeriodicTasks`, `GetAllIPSets`, `GetIPSet`, `CreateIPSets`, `DeleteIPSet`, `AddToSets`, `RemoveFromSets`, `AddToLists`, `RemoveFromList`, `ApplyDataPlane`, `GetAllPolicies`, `AddPolicy`, `RemovePolicy`, `UpdatePolicy`. 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. — npm/pkg/dataplane/types.go:13
`HnsV2WrapperInterface` declares 18 methods: `CreateEndpoint`, `DeleteEndpoint`, `CreateNetwork`, `DeleteNetwork`, `ModifyNetworkSettings`, `AddNetworkPolicy`, `RemoveNetworkPolicy`, `GetNamespaceByID`, `AddNamespaceEndpoint`, `RemoveNamespaceEndpoint`, `GetNetworkByName`, `GetNetworkByID`, `GetEndpointByID`, `ListEndpointsOfNetwork`, `ListEndpointsQuery`, `ApplyEndpointPolicy`, `GetEndpointByName`, `HNSV2Supported`. 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. — network/hnswrapper/hnsv2wrapperinterface.go:11
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
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.
tools/azure-npm-to-cilium-validator/README.md names Go 1.16 or later, but REDACTED:3 requires `go 1.25.0` (the lowest of 12 declarations): the code does not build on Go 1.16. 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. — tools/azure-npm-to-cilium-validator/README.md:13
What to do
Reconcile the README with reality: tools/azure-npm-to-cilium-validator/README.md names Go 1.16 or later, but REDACTED:3 requires `go 1.25.0` (the lowest of 12 declarations): the code does not build on Go 1.16.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Only 7/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cilium-log-collector`, `pkgerrlint`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ 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).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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. — cns/dockerclient/dockerclient.go:49
`http.Post(` 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. — cns/dockerclient/dockerclient.go:116
`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. — cns/dockerclient/dockerclient.go:162
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.
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.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether 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 37/50 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.
`Dial` calls `net.Dial(…)` 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, …)`. — telemetry/telemetrybuffer_linux.go:20
`NodeIP` calls `net.Dial(…)` 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, …)`. — REDACTED:388
`NpmCache` calls `http.NewRequestWithContext(…)` 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, …)`. — npm/pkg/dataplane/debug/converter.go:65
`GetNpmMgr` 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, …)`. — npm/http/client/client.go:27
`GetHostMetadata` 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, …)`. — common/utils.go:172
`GetAzureCloud` 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, …)`. — common/utils.go:234
`SetNodeOrchestrator` 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, …)`. — cns/restserver/internalapi.go:39
`SyncNodeStatus` calls `http.NewRequestWithContext(…)` 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, …)`. — cns/restserver/internalapi.go:46
`listenIPAMSocket` calls `net.DialTimeout(…)` 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, …)`. — cns/restserver/ipam_server_linux.go:25
`NetworkExists` calls `http.Get(…)` 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, …)`. — cns/dockerclient/dockerclient.go:46
`CreateNetwork` calls `http.Post(…)` 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, …)`. — cns/dockerclient/dockerclient.go:74
`DeleteNetwork` 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, …)`. — cns/dockerclient/dockerclient.go:150
`DetermineSnatFeatureOnHost` calls `http.NewRequestWithContext(…)` 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, …)`. — cni/network/multitenancy.go:77
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` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … 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 guard5.4 / 10Adequate✓ Tool-verified
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.
`parts` holds what `Split` returns, and `parts[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(parts)` (or nil) first, as the other call site does. — platform/os_windows.go:547
`ret` holds what `Split` returns, and `ret[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(ret)` (or nil) first, as the other call site does. (×2) — npm/pkg/dataplane/debug/trafficanalyzer.go:455, npm/pkg/dataplane/debug/trafficanalyzer.go:460
`strings.Split(routeTable[1], " ")[1]` takes element 1 of what `Split` returns without checking its length, and this file tests that same result elsewhere before indexing it — the result can be nil or shorter. Here a short result panics with `index out of range`. Assign it and test `len` (or nil) first, as the other call site does. — cns/routes/routes_windows.go:71
`routePrint` holds what `Split` returns, and `routePrint[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(routePrint)` (or nil) first, as the other call site does. — cns/routes/routes_windows.go:69
`routeTable` holds what `Split` returns, and `routeTable[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(routeTable)` (or nil) first, as the other call site does. — cns/routes/routes_windows.go:71
What to do
Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
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.
`if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here. — telemetry/telemetry.go:160
`if readErr != 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. — telemetry/telemetrybuffer.go:143
`tb.Cleanup(FdName)` returns an error, and the statement drops it: when `tb.Cleanup` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := tb.Cleanup(FdName); 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. (×2) — telemetry/telemetrybuffer.go:200, telemetry/telemetrybuffer.go:378
`tb.StartTelemetryService(path, args)` returns an error, and the statement drops it: when `tb.StartTelemetryService` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := tb.StartTelemetryService(path, args); 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. — telemetry/telemetrybuffer.go:379
`ex, _ := os.Executable()` writes the call's error to `_` and then uses `ex` as if the call succeeded. When `os.Executable` fails, `ex` 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 `ex` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — telemetry/telemetrybuffer.go:408
`if _, err := os.Stat(kvs.fileName); 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. — store/json.go:60
`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. (×4) — platform/os_linux.go:50, REDACTED:217, REDACTED:225, …
`if canaryErr != 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. — npm/pkg/dataplane/policies/chain-management_linux.go:284
`_, ipnet, _ := net.ParseCIDR(strings.TrimSpace(entrySplitted[0]))` writes the call's error to `_` and then uses `ipnet` as if the call succeeded. When `net.ParseCIDR` fails, `ipnet` 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 `ipnet` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — npm/pkg/dataplane/debug/trafficanalyzer.go:441
`podKey, _ := cache.MetaNamespaceKeyFunc(podObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — npm/pkg/controlplane/controllers/v2/podController.go:371, npm/pkg/controlplane/controllers/v1/podController.go:333
`podKey, _ := cache.MetaNamespaceKeyFunc(newPodObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — npm/pkg/controlplane/controllers/v2/podController.go:421, npm/pkg/controlplane/controllers/v1/podController.go:397
`l.Close()` returns an error, and the statement drops it: when `l.Close` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := l.Close(); 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. — npm/iptm/ioshim.go:61
`if err := grabIptablesFileLock(i.iptablesLockFile); 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. — npm/iptm/ioshim.go:74
`lineNum, _ := strconv.Atoi(lineNumberString)` writes the call's error to `_` and then uses `lineNum` as if the call succeeded. When `strconv.Atoi` fails, `lineNum` 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 `lineNum` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — npm/iptm/iptm.go:457
`addRuleToRouteViaHost(epInfo)` returns an error, and the statement drops it: when `addRuleToRouteViaHost` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := addRuleToRouteViaHost(epInfo); 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:113
`_, v6IpNet, _ := net.ParseCIDR(epInfo.VnetCidrs)` writes the call's error to `_` and then uses `v6IpNet` as if the call succeeded. When `net.ParseCIDR` fails, `v6IpNet` 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 `v6IpNet` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:262
`_, defIPNet, _ := net.ParseCIDR("::/0")` writes the call's error to `_` and then uses `defIPNet` as if the call succeeded. When `net.ParseCIDR` fails, `defIPNet` 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 `defIPNet` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:281
`if err := addRoutes(client.netlink, client.netioshim, client.containerVethName, routes); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:292
`hardwareAddr, _ := net.ParseMAC(defaultHostGwMac)` writes the call's error to `_` and then uses `hardwareAddr` as if the call succeeded. When `net.ParseMAC` fails, `hardwareAddr` 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 `hardwareAddr` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:303
`_, mIpNet, _ := net.ParseCIDR(multicastSolicitPrefix)` writes the call's error to `_` and then uses `mIpNet` as if the call succeeded. When `net.ParseCIDR` fails, `mIpNet` 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 `mIpNet` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. (×2) — network/bridge_networkclient_linux.go:121, network/bridge_networkclient_linux.go:159
`ebtables.SetVepaMode(client.bridgeName, commonInterfacePrefix, virtualMacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetVepaMode` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetVepaMode(client.bridgeName, commonInterfacePrefix, virtualMacAddress, ebtables.Delete); 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. — network/bridge_networkclient_linux.go:151
`ebtables.SetDnatForArpReplies(extIf.Name, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetDnatForArpReplies` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetDnatForArpReplies(extIf.Name, ebtables.Delete); 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. — network/bridge_networkclient_linux.go:152
`ebtables.SetArpReply(extIf.IPAddresses[0].IP, extIf.MacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetArpReply` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetArpReply(extIf.IPAddresses[0].IP, extIf.MacAddress, ebtables.Delete); 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. — network/bridge_networkclient_linux.go:153
`ebtables.SetSnatForInterface(extIf.Name, extIf.MacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetSnatForInterface` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetSnatForInterface(extIf.Name, extIf.MacAddress, ebtables.Delete); 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. — network/bridge_networkclient_linux.go:154
`ebtables.SetBrouteAcceptByCidr(extIf.IPAddresses[1], ebtables.IPV6, ebtables.Delete, ebtables.Accept)` returns an error, and the statement drops it: when `ebtables.SetBrouteAcceptByCidr` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetBrouteAcceptByCidr(extIf.IPAddresses[1], ebtables.IPV6, ebtables.Delete, ebtables.Accept); 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. — network/bridge_networkclient_linux.go:157
`ebtables.SetBrouteAcceptByCidr(mIpNet, ebtables.IPV6, ebtables.Delete, ebtables.Accept)` returns an error, and the statement drops it: when `ebtables.SetBrouteAcceptByCidr` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetBrouteAcceptByCidr(mIpNet, ebtables.IPV6, ebtables.Delete, ebtables.Accept); 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. — network/bridge_networkclient_linux.go:160
`client.setBrouteRedirect(ebtables.Delete)` returns an error, and the statement drops it: when `client.setBrouteRedirect` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := client.setBrouteRedirect(ebtables.Delete); 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. — network/bridge_networkclient_linux.go:161
`ebtables.DropICMPv6Solicitation(extIf.Name, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.DropICMPv6Solicitation` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.DropICMPv6Solicitation(extIf.Name, ebtables.Delete); 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. — network/bridge_networkclient_linux.go:162
`epClient.DeleteEndpoints(ep)` returns an error, and the statement drops it: when `epClient.DeleteEndpoints` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := epClient.DeleteEndpoints(ep); 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:303
`devIf, _ := netioshim.GetNetworkInterfaceByName(route.DevName)` writes the call's error to `_` and then uses `devIf` as if the call succeeded. When `netioshim.GetNetworkInterfaceByName` fails, `devIf` 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 `devIf` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:332
`_, defDstIP, _ := net.ParseCIDR("0.0.0.0/0")` writes the call's error to `_` and then uses `defDstIP` as if the call succeeded. When `net.ParseCIDR` fails, `defDstIP` 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 `defDstIP` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:545
`if err := nw.addIPv6NeighborEntryForGateway(epInfo, plc); err != nil {` declares a NEW `err` in an inner scope, and the failure it carries leaves through a `return` — but the deferred cleanup tests the outer `err`, which stays nil, so the cleanup (a rollback, a removal) never runs on that failure. Assign the outer variable (`=`), or name the function's error result `err` so `return` sets what the deferred function reads. — network/endpoint_windows.go:241
`nw.deleteHostNCApipaEndpoint(epInfo.NetworkContainerID)` returns an error, and the statement drops it: when `nw.deleteHostNCApipaEndpoint` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := nw.deleteHostNCApipaEndpoint(epInfo.NetworkContainerID); 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. — network/endpoint_windows.go:432
What to do
Lost error (reports an error that is nil on this path)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`Info` at line 118 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. — cns/logger/cnslogger.go:118
`Debug` at line 131 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. — cns/logger/cnslogger.go:131
`Warn` at line 144 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. — cns/logger/cnslogger.go:144
`Error` at line 157 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.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — cns/logger/cnslogger.go:157
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 18 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 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 — 52 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.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — 7 | 8 | # mcr.microsoft.com/azurelinux/base/core:3.0 -------------------- ERROR: failed to solve: failed to parse platform linux/${ARCH}: "" is an invalid component of "linux/": platform specifier component must match "^[A-Za-z0-9_-]+$": invalid argument; likely cause (not identified): the image build failed, and its output does not match a cause we recognise; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
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 — ~95318 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 (cns), 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 — this repository's production source is .go, .py, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 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.
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
DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 6 value object(s)
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 CQRS handler(s); 1 event-sourced shape(s) (event folds / event-recording aggregates)
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 30 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
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.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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 (78,517 lines), c (342 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 — X13 reached only 0% of this repository's production lines — go (78,517 lines), c (342 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — not 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
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 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
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 analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Orphaned knowledge npm/pkg/controlplane/controllers/v1/translatePolicy.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/dataplane/dataplane.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/dataplane/policies/chain-management_linux.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/controlplane/controllers/v1/podController.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/controlplane/controllers/v1/networkPolicyController.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge network/network_linux.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge network/snat/snat_linux.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge npm/pkg/dataplane/dataplane_windows.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge network/policy/policy_windows.go:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
TodoComment zapai/encoder.go:78— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:83— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:87— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:91— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:95— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:99— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:103— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:107— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:111— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:115— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:119— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:123— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:127— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:131— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:135— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:139— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:143— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:147— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/encoder.go:152— // TODO to be implemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment zapai/mappers.go:1— //nolint:revive // TODO(rbtr) docstrings — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/internal/retry/retry.go:1— // todo: there are more robust retry packages out there, discuss with team — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/internal/kubernetes/utils_create.go:946— // TODO: add windows cni conflist when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/internal/kubernetes/utils_create.go:973— // TODO: add windows cni conflist when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/internal/kubernetes/utils_create.go:1039— // TODO: add windows cni conflist when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment test/integration/portforward.go:68— // todo: can be made more flexible to allow a service to be specified — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
+ 323 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium CVE · ×19
Duplicated block (11 lines × 2) cni/network/plugin/main.go:145— cni/network/plugin/main.go:145-155 | cni/network/stateless/main.go:130-140 — `cni/network/plugin/main.go` and `cni/network/stateless/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 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. 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) cns/client/client.go:154— cns/client/client.go:154-164 | cns/client/client.go:214-224 — both copies are in the same file, so extract the 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 (11 lines × 2) cns/client/client.go:404— cns/client/client.go:404-414 | cns/client/client.go:497-507 — both copies are in the same file, so extract the 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 (11 lines × 2) cns/cniconflist/generator_linux.go:58— cns/cniconflist/generator_linux.go:58-68 | cns/cniconflist/generator_linux.go:87-97 — both copies are in the same file, so extract the 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 `cns/cniconflist/generator_linux.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.
Duplicated block (11 lines × 2) cns/kubecontroller/nodenetworkconfig/conversion_linux.go:60— cns/kubecontroller/nodenetworkconfig/conversion_linux.go:60-70 | cns/kubecontroller/nodenetworkconfig/conversion_windows.go:72-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) cns/restserver/api.go:978— cns/restserver/api.go:978-988 | cns/restserver/api.go:1009-1019 — both copies are in the same file, so extract the 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 `cns/restserver/api.go:978` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) cns/restserver/api.go:1128— cns/restserver/api.go:1128-1138 | cns/restserver/api.go:1165-1175 — both copies are in the same file, so extract the 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 `cns/restserver/api.go:1128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) ipam/azure.go:150— ipam/azure.go:150-160 | ipam/fileIpam.go:164-174 — 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) network/hnswrapper/hnsv2wrapperfake.go:296— network/hnswrapper/hnsv2wrapperfake.go:296-306 | network/hnswrapper/hnsv2wrapperfake.go:324-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) npm/controller/server.go:79— npm/controller/server.go:79-89 | npm/npm.go:77-87 — 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 `npm/controller/server.go:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) npm/controller/server.go:142— npm/controller/server.go:142-152 | npm/npm.go:201-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. 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:303— npm/pkg/controlplane/controllers/v1/translatePolicy.go:303-313 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:953-963 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:303` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) server/tls/tlscertificate_retriever_linux.go:41— server/tls/tlscertificate_retriever_linux.go:41-51 | server/tls/tlscertificate_retriever_windows.go:44-54 — before extracting anything, compare `server/tls/tlscertificate_retriever_linux.go` and `server/tls/tlscertificate_retriever_windows.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (11 lines × 2) cns/ipampool/metrics/observer.go:70— cns/ipampool/metrics/observer.go:70-80 | cns/ipampool/monitor.go:429-439 — 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) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:41— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:41-51 | npm/pkg/controlplane/controllers/v2/namespaceController.go:45-55 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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) cni/network/network.go:971— cni/network/network.go:971-981 | cni/network/network.go:1294-1305 — both copies are in the same file, so extract the 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 `cni/network/network.go:971` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.go:159— npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.go:159-169 | npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.go:188-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.go:159` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) tools/failure-agent/internal/command/policy.go:60— tools/failure-agent/internal/command/policy.go:60-70 | tools/failure-agent/internal/command/privileged.go:17-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) tools/failure-agent/internal/report/report.go:191— tools/failure-agent/internal/report/report.go:191-201 | tools/failure-agent/internal/weekly/weekly.go:282-292 — 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 `tools/failure-agent/internal/report/report.go:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X3 · Exception handling· Discarded error (an error-returning call as a bare statement) · ×15
Discarded error (an error-returning call as a bare statement) telemetry/telemetrybuffer.go:200— `tb.Cleanup(FdName)` returns an error, and the statement drops it: when `tb.Cleanup` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := tb.Cleanup(FdName); 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) telemetry/telemetrybuffer.go:378— `tb.Cleanup(FdName)` returns an error, and the statement drops it: when `tb.Cleanup` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := tb.Cleanup(FdName); 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) telemetry/telemetrybuffer.go:379— `tb.StartTelemetryService(path, args)` returns an error, and the statement drops it: when `tb.StartTelemetryService` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := tb.StartTelemetryService(path, args); 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) npm/iptm/ioshim.go:61— `l.Close()` returns an error, and the statement drops it: when `l.Close` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := l.Close(); 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:113— `addRuleToRouteViaHost(epInfo)` returns an error, and the statement drops it: when `addRuleToRouteViaHost` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := addRuleToRouteViaHost(epInfo); 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) network/bridge_networkclient_linux.go:151— `ebtables.SetVepaMode(client.bridgeName, commonInterfacePrefix, virtualMacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetVepaMode` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetVepaMode(client.bridgeName, commonInterfacePrefix, virtualMacAddress, ebtables.Delete); 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) network/bridge_networkclient_linux.go:152— `ebtables.SetDnatForArpReplies(extIf.Name, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetDnatForArpReplies` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetDnatForArpReplies(extIf.Name, ebtables.Delete); 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) network/bridge_networkclient_linux.go:153— `ebtables.SetArpReply(extIf.IPAddresses[0].IP, extIf.MacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetArpReply` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetArpReply(extIf.IPAddresses[0].IP, extIf.MacAddress, ebtables.Delete); 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) network/bridge_networkclient_linux.go:154— `ebtables.SetSnatForInterface(extIf.Name, extIf.MacAddress, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.SetSnatForInterface` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetSnatForInterface(extIf.Name, extIf.MacAddress, ebtables.Delete); 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) network/bridge_networkclient_linux.go:157— `ebtables.SetBrouteAcceptByCidr(extIf.IPAddresses[1], ebtables.IPV6, ebtables.Delete, ebtables.Accept)` returns an error, and the statement drops it: when `ebtables.SetBrouteAcceptByCidr` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetBrouteAcceptByCidr(extIf.IPAddresses[1], ebtables.IPV6, ebtables.Delete, ebtables.Accept); 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) network/bridge_networkclient_linux.go:160— `ebtables.SetBrouteAcceptByCidr(mIpNet, ebtables.IPV6, ebtables.Delete, ebtables.Accept)` returns an error, and the statement drops it: when `ebtables.SetBrouteAcceptByCidr` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.SetBrouteAcceptByCidr(mIpNet, ebtables.IPV6, ebtables.Delete, ebtables.Accept); 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) network/bridge_networkclient_linux.go:161— `client.setBrouteRedirect(ebtables.Delete)` returns an error, and the statement drops it: when `client.setBrouteRedirect` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := client.setBrouteRedirect(ebtables.Delete); 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) network/bridge_networkclient_linux.go:162— `ebtables.DropICMPv6Solicitation(extIf.Name, ebtables.Delete)` returns an error, and the statement drops it: when `ebtables.DropICMPv6Solicitation` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := ebtables.DropICMPv6Solicitation(extIf.Name, ebtables.Delete); 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:303— `epClient.DeleteEndpoints(ep)` returns an error, and the statement drops it: when `epClient.DeleteEndpoints` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := epClient.DeleteEndpoints(ep); 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) network/endpoint_windows.go:432— `nw.deleteHostNCApipaEndpoint(epInfo.NetworkContainerID)` returns an error, and the statement drops it: when `nw.deleteHostNCApipaEndpoint` fails nothing records it and the code after it runs as if it had succeeded. Check it (`if err := nw.deleteHostNCApipaEndpoint(epInfo.NetworkContainerID); 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) · ×14
Discarded error (assigned to `_`, then its result used) telemetry/telemetrybuffer.go:408— `ex, _ := os.Executable()` writes the call's error to `_` and then uses `ex` as if the call succeeded. When `os.Executable` fails, `ex` 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 `ex` (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) npm/pkg/dataplane/debug/trafficanalyzer.go:441— `_, ipnet, _ := net.ParseCIDR(strings.TrimSpace(entrySplitted[0]))` writes the call's error to `_` and then uses `ipnet` as if the call succeeded. When `net.ParseCIDR` fails, `ipnet` 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 `ipnet` (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) npm/pkg/controlplane/controllers/v2/podController.go:371— `podKey, _ := cache.MetaNamespaceKeyFunc(podObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (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) npm/pkg/controlplane/controllers/v2/podController.go:421— `podKey, _ := cache.MetaNamespaceKeyFunc(newPodObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (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) npm/pkg/controlplane/controllers/v1/podController.go:333— `podKey, _ := cache.MetaNamespaceKeyFunc(podObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (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) npm/pkg/controlplane/controllers/v1/podController.go:397— `podKey, _ := cache.MetaNamespaceKeyFunc(newPodObj)` writes the call's error to `_` and then uses `podKey` as if the call succeeded. When `cache.MetaNamespaceKeyFunc` fails, `podKey` 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 `podKey` (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) npm/iptm/iptm.go:457— `lineNum, _ := strconv.Atoi(lineNumberString)` writes the call's error to `_` and then uses `lineNum` as if the call succeeded. When `strconv.Atoi` fails, `lineNum` 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 `lineNum` (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) REDACTED:262— `_, v6IpNet, _ := net.ParseCIDR(epInfo.VnetCidrs)` writes the call's error to `_` and then uses `v6IpNet` as if the call succeeded. When `net.ParseCIDR` fails, `v6IpNet` 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 `v6IpNet` (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) REDACTED:281— `_, defIPNet, _ := net.ParseCIDR("::/0")` writes the call's error to `_` and then uses `defIPNet` as if the call succeeded. When `net.ParseCIDR` fails, `defIPNet` 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 `defIPNet` (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) REDACTED:303— `hardwareAddr, _ := net.ParseMAC(defaultHostGwMac)` writes the call's error to `_` and then uses `hardwareAddr` as if the call succeeded. When `net.ParseMAC` fails, `hardwareAddr` 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 `hardwareAddr` (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) network/bridge_networkclient_linux.go:121— `_, mIpNet, _ := net.ParseCIDR(multicastSolicitPrefix)` writes the call's error to `_` and then uses `mIpNet` as if the call succeeded. When `net.ParseCIDR` fails, `mIpNet` 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 `mIpNet` (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) network/bridge_networkclient_linux.go:159— `_, mIpNet, _ := net.ParseCIDR(multicastSolicitPrefix)` writes the call's error to `_` and then uses `mIpNet` as if the call succeeded. When `net.ParseCIDR` fails, `mIpNet` 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 `mIpNet` (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) REDACTED:332— `devIf, _ := netioshim.GetNetworkInterfaceByName(route.DevName)` writes the call's error to `_` and then uses `devIf` as if the call succeeded. When `netioshim.GetNetworkInterfaceByName` fails, `devIf` 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 `devIf` (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) REDACTED:545— `_, defDstIP, _ := net.ParseCIDR("0.0.0.0/0")` writes the call's error to `_` and then uses `defDstIP` as if the call succeeded. When `net.ParseCIDR` fails, `defDstIP` 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 `defDstIP` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
X2 · Cancellation propagation· Function without context.Context · ×13
Function without context.Context: Dial telemetry/telemetrybuffer_linux.go:20— `Dial` calls `net.Dial(…)` 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: NodeIP REDACTED:388— `NodeIP` calls `net.Dial(…)` 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: NpmCache npm/pkg/dataplane/debug/converter.go:65— `NpmCache` calls `http.NewRequestWithContext(…)` 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: GetNpmMgr npm/http/client/client.go:27— `GetNpmMgr` 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: GetHostMetadata common/utils.go:172— `GetHostMetadata` 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: GetAzureCloud common/utils.go:234— `GetAzureCloud` 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: SetNodeOrchestrator cns/restserver/internalapi.go:39— `SetNodeOrchestrator` 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: SyncNodeStatus cns/restserver/internalapi.go:46— `SyncNodeStatus` calls `http.NewRequestWithContext(…)` 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: listenIPAMSocket cns/restserver/ipam_server_linux.go:25— `listenIPAMSocket` calls `net.DialTimeout(…)` 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: NetworkExists cns/dockerclient/dockerclient.go:46— `NetworkExists` calls `http.Get(…)` 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: CreateNetwork cns/dockerclient/dockerclient.go:74— `CreateNetwork` calls `http.Post(…)` 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: DeleteNetwork cns/dockerclient/dockerclient.go:150— `DeleteNetwork` 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: DetermineSnatFeatureOnHost cni/network/multitenancy.go:77— `DetermineSnatFeatureOnHost` calls `http.NewRequestWithContext(…)` 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 (8 lines × 2) cns/client/client.go:353— cns/client/client.go:353-360 | cns/client/client.go:440-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/client/client.go:353` 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) cns/service/main.go:1339— cns/service/main.go:1339-1346 | cns/service/main.go:1688-1695 — both copies are in the same file, so extract the 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 `cns/service/main.go:1339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cns/service/main.go:1696` calls `Printf` and `cns/service/main.go:1347` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) dropgz/cmd/payload.go:66— dropgz/cmd/payload.go:66-73 | dropgz/cmd/payload.go:96-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 `dropgz/cmd/payload.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.
Duplicated block (8 lines × 2) network/transparent_endpointclient_linux.go:223— network/transparent_endpointclient_linux.go:223-230 | network/transparent_vlan_endpointclient_linux.go:632-639 — 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 `network/transparent_endpointclient_linux.go:223` it does not close everything it opens, so those exact lines 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) cns/fakes/requestcontrollerfake.go:122— cns/fakes/requestcontrollerfake.go:122-129 | ipam/ipv6Ipam.go:283-290 — 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) network/manager.go:900— network/manager.go:900-907 | network/manager_mock.go:216-223 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) npm/pkg/controlplane/controllers/common/namespace.go:23— npm/pkg/controlplane/controllers/common/namespace.go:23-30 | npm/pkg/controlplane/controllers/common/pod.go:45-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) cns/wireserver/proxy.go:36— cns/wireserver/proxy.go:36-43 | cns/wireserver/proxy.go:55-62 — both copies are in the same file, so extract the 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 `cns/wireserver/proxy.go:36` it does not close everything it opens, so those exact lines 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) nmagent/client.go:63— nmagent/client.go:63-70 | nmagent/client.go:108-115 — both copies are in the same file, so extract the 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 `nmagent/client.go:63` it does not close everything it opens, so those 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 (8 lines × 2) cns/wireserver/proxy.go:73— cns/wireserver/proxy.go:73-80 | cns/wireserver/proxy.go:98-105 — both copies are in the same file, so extract the 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 `cns/wireserver/proxy.go: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 (8 lines × 2) network/network_linux.go:86— network/network_linux.go:86-93 | network/network_linux.go:95-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) npm/pkg/dataplane/dpshim/dpshim.go:166— npm/pkg/dataplane/dpshim/dpshim.go:166-173 | npm/pkg/dataplane/dpshim/dpshim.go:234-241 — both copies are in the same file, so extract the 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, `npm/pkg/dataplane/dpshim/dpshim.go:164` calls `Infof`, `GetPrefixName` and `npm/pkg/dataplane/dpshim/dpshim.go:232` 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 × 2) cni/ipam/ipam.go:147— cni/ipam/ipam.go:147-153 | cni/ipam/ipam.go:287-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cni/ipam/ipam.go:147` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cni/ipam/ipam.go:155` calls `Any` and `cni/ipam/ipam.go:295` 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 × 2) cns/kubecontroller/nodenetworkconfig/conversion_linux.go:25— cns/kubecontroller/nodenetworkconfig/conversion_linux.go:25-31 | cns/kubecontroller/nodenetworkconfig/conversion_linux.go:49-55 — both copies are in the same file, so extract the 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 `cns/kubecontroller/nodenetworkconfig/conversion_linux.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 × 2) cns/restserver/api.go:1049— cns/restserver/api.go:1049-1055 | cns/restserver/api.go:1206-1212 — both copies are in the same file, so extract the 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 `cns/restserver/api.go:1049` 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) cns/restserver/ipam.go:1514— cns/restserver/ipam.go:1514-1520 | cns/restserver/ipam.go:1536-1542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/restserver/ipam.go:1514` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cns/restserver/ipam.go:1521` calls `verifyUpdateEndpointStateRequest` and `cns/restserver/ipam.go:1543` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1647— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1647-1653 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1667-1673 — both copies are in the same file, so extract the block into 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) npm/pkg/dataplane/ipsets/dirtycache_linux.go:17— npm/pkg/dataplane/ipsets/dirtycache_linux.go:17-23 | npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:605-611 — 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 `npm/pkg/dataplane/ipsets/dirtycache_linux.go:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) server/tls/tlscertificate_retriever_linux.go:54— server/tls/tlscertificate_retriever_linux.go:54-60 | server/tls/tlscertificate_retriever_windows.go:57-63 — before extracting anything, compare `server/tls/tlscertificate_retriever_linux.go` and `server/tls/tlscertificate_retriever_windows.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) telemetry/telemetrybuffer_linux.go:44— telemetry/telemetrybuffer_linux.go:44-50 | telemetry/telemetrybuffer_windows.go:46-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) cni/network/network.go:405— cni/network/network.go:405-412 | cni/network/network.go:1053-1059 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cni/network/network.go:405` 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) cns/restserver/ipam.go:579— cns/restserver/ipam.go:579-585 | cns/restserver/ipam.go:634-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/restserver/ipam.go:579` it does not close everything it opens, so those exact lines 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) cns/logger/cnslogger.go:183— cns/logger/cnslogger.go:183-189 | cns/logger/cnslogger.go:202-208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/logger/cnslogger.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `string` to `c *logger) Response(tag` in one and `c *logger) ResponseEx(tag` 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) network/networkutils/networkutils_linux.go:39— network/networkutils/networkutils_linux.go:39-45 | network/snat/snat_linux.go:31-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `network/networkutils/networkutils_linux.go:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `network/snat/snat_linux.go:39` calls `CreateChain` and `network/networkutils/networkutils_linux.go:47` 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 × 2) cni/ipam/ipam.go:156— cni/ipam/ipam.go:156-168 | cni/ipam/ipam.go:295-307 — both copies are in the same file, so extract the 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 `cni/ipam/ipam.go:156` 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, `cni/ipam/ipam.go:155` calls `Any` and `cni/ipam/ipam.go:294` 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 (13 lines × 2) nmagent/client.go:264— nmagent/client.go:264-276 | nmagent/client.go:291-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `nmagent/client.go:306` calls `die` and `nmagent/client.go:278` 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 × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1424— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1424-1436 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1456-1468 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1424` 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) server/tls/tlscertificate_retriever_linux.go:25— server/tls/tlscertificate_retriever_linux.go:25-37 | server/tls/tlscertificate_retriever_windows.go:28-40 — before extracting anything, compare `server/tls/tlscertificate_retriever_linux.go` and `server/tls/tlscertificate_retriever_windows.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) network/hnswrapper/hnsv2wrapperwithtimeout.go:309— network/hnswrapper/hnsv2wrapperwithtimeout.go:309-321 | network/hnswrapper/hnsv2wrapperwithtimeout.go:394-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `network/hnswrapper/hnsv2wrapperwithtimeout.go:309` 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) npm/pkg/dataplane/dataplane.go:255— npm/pkg/dataplane/dataplane.go:255-267 | npm/pkg/dataplane/dataplane.go:278-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/dataplane/dataplane.go:255` it does not close everything it opens, so those 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 (13 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:227— npm/pkg/controlplane/controllers/v1/translatePolicy.go:227-239 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:881-893 — both copies are in the same file, so extract the block into 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) network/hnswrapper/hnsv2wrapperwithtimeout.go:331— network/hnswrapper/hnsv2wrapperwithtimeout.go:331-343 | network/hnswrapper/hnsv2wrapperwithtimeout.go:355-367 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `network/hnswrapper/hnsv2wrapperwithtimeout.go:331` 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1548— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1548-1560 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1565-1577 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1548` 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) tools/release/internal/version/version.go:138— tools/release/internal/version/version.go:138-150 | tools/release/internal/version/version.go:157-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) cni/network/plugin/main.go:68— cni/network/plugin/main.go:68-76 | cni/network/stateless/main.go:75-83 — `cni/network/plugin/main.go` and `cni/network/stateless/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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cni/network/plugin/main.go:68` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) cns/client/client.go:583— cns/client/client.go:583-591 | cns/client/client.go:612-620 — both copies are in the same file, so extract the 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) network/snat/snat_linux.go:266— network/snat/snat_linux.go:266-274 | network/snat/snat_linux.go:364-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `network/snat/snat_linux.go:266` it does not close everything it opens, so those exact lines 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) network/transparent_endpointclient_linux.go:144— network/transparent_endpointclient_linux.go:144-152 | network/transparent_endpointclient_linux.go:176-184 — both copies are in the same file, so extract the 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 `network/transparent_endpointclient_linux.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 (9 lines × 2) platform/os_windows.go:347— platform/os_windows.go:347-355 | platform/os_windows.go:386-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 `platform/os_windows.go:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (9 lines × 2) cns/restserver/ipam.go:615— cns/restserver/ipam.go:615-623 | cns/restserver/ipam.go:646-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:114— npm/pkg/controlplane/controllers/v1/networkPolicyController.go:114-122 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:87-95 — `npm/pkg/controlplane/controllers/v1/networkPolicyController.go` and `npm/pkg/controlplane/controllers/v2/networkPolicyController.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 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) npm/cmd/start_daemon.go:94— npm/cmd/start_daemon.go:94-102 | REDACTED:113-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `npm/cmd/start_daemon.go:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) npm/pkg/controlplane/gobutils.go:12— npm/pkg/controlplane/gobutils.go:12-20 | npm/pkg/controlplane/gobutils.go:36-44 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) tools/acncli/cmd/cni/logs.go:16— tools/acncli/cmd/cni/logs.go:16-24 | tools/acncli/cmd/logs.go:16-24 — before extracting anything, compare `tools/acncli/cmd/cni/logs.go` and `tools/acncli/cmd/logs.go` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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.
FileTooLong: v1/translatePolicy.go npm/pkg/controlplane/controllers/v1/translatePolicy.go— FileTooLong — 1269 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 769 over it, 2.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: service/main.go cns/service/main.go— FileTooLong — 1147 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 647 over it, 2.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: restserver/ipam.go cns/restserver/ipam.go— FileTooLong — 1051 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: HTTPRestService (51 blocks, 46-1690). The bar is 500 significant lines; this is 551 over it, 2.10× 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: restserver/api.go cns/restserver/api.go— FileTooLong — 964 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: HTTPRestService (32 blocks, 47-1475). The bar is 500 significant lines; this is 464 over it, 1.93× 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: network/network.go cni/network/network.go— FileTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: NetPlugin (19 blocks, 102-1544). The bar is 500 significant lines; this is 432 over it, 1.86× 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: restserver/util.go cns/restserver/util.go— FileTooLong — 750 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: HTTPRestService (33 blocks, 33-1174). The bar is 500 significant lines; this is 250 over it, 1.50× 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: client/client.go cns/client/client.go— FileTooLong — 692 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: Client (26 blocks, 76-1221). The bar is 500 significant lines; this is 192 over it, 1.38× 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: network/manager.go network/manager.go— FileTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: networkManager (29 blocks, 85-907). The bar is 500 significant lines; this is 40 over it, 1.08× 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: network/transparent_vlan_endpointclient_linux.go network/transparent_vlan_endpointclient_linux.go— FileTooLong — 510 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: TransparentVlanEndpointClient (24 blocks, 81-828). The bar is 500 significant lines; this is 10 over it, 1.02× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Duplicated block (12 lines × 2) cni/network/multitenancy.go:219— cni/network/multitenancy.go:219-230 | cni/network/multitenancy_mock.go:86-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cni/network/multitenancy.go:219` it does not close everything it opens, so those exact lines 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) cni/network/network_windows.go:139— cni/network/network_windows.go:139-150 | cni/network/network_windows.go:160-171 — both copies are in the same file, so extract the 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) REDACTED:121— REDACTED:121-132 | REDACTED:150-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.
Duplicated block (12 lines × 2) network/endpoint_windows.go:90— network/endpoint_windows.go:90-101 | network/endpoint_windows.go:105-116 — both copies are in the same file, so extract the 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, `network/endpoint_windows.go:103` calls `Info` and `network/endpoint_windows.go:88` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) network/network_windows.go:165— network/network_windows.go:165-176 | network/network_windows.go:434-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:80— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:80-91 | npm/pkg/controlplane/controllers/v2/namespaceController.go:88-99 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `npm/pkg/controlplane/controllers/v1/nameSpaceController.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.
Duplicated block (12 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:710— npm/pkg/controlplane/controllers/v1/translatePolicy.go:710-721 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1365-1376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:710` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) network/hnswrapper/hnsv1wrapperwithtimeout.go:92— network/hnswrapper/hnsv1wrapperwithtimeout.go:92-103 | network/hnswrapper/hnsv1wrapperwithtimeout.go:114-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `network/hnswrapper/hnsv1wrapperwithtimeout.go:92` 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 × 2) cni/network/network.go:471— cni/network/network.go:471-482 | cni/network/network.go:1293-1304 — both copies are in the same file, so extract the 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 `cni/network/network.go:471` it does not close everything it opens, so those 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: `cni/network/network.go:1293` is reached only past a guard at line 1272 that tests `args.StdinData` and leaves the function early, and `cni/network/network.go:471` reads `args.StdinData` 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 (10 lines × 2) cns/service.go:247— cns/service.go:247-256 | cns/service.go:301-310 — both copies are in the same file, so extract the 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 `cns/service.go:247` 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) cns/stateprovider/cns/podinfoprovider.go:50— cns/stateprovider/cns/podinfoprovider.go:50-59 | cns/stateprovider/cns/podinfoprovider.go:61-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. Read the line range as the matched WINDOW rather than a finished unit: at `cns/stateprovider/cns/podinfoprovider.go:50` 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) REDACTED:49— REDACTED:49-58 | REDACTED:31-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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 (10 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:732— npm/pkg/controlplane/controllers/v1/translatePolicy.go:732-741 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1388-1397 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:732` it does not close everything it opens, so those exact lines 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) crd/clustersubnetstate/api/v1alpha1/groupversion_info.go:14— crd/clustersubnetstate/api/v1alpha1/groupversion_info.go:14-23 | crd/overlayextensionconfig/api/v1alpha1/groupversion_info.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.
Duplicated block (10 lines × 2) network/ovsinfravnet/infravnet_linux.go:117— network/ovsinfravnet/infravnet_linux.go:117-126 | network/snat/snat_linux.go:169-178 — 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) npm/pkg/dataplane/dpshim/dpshim.go:157— npm/pkg/dataplane/dpshim/dpshim.go:157-166 | npm/pkg/dataplane/dpshim/dpshim.go:188-197 — both copies are in the same file, so extract the 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 `npm/pkg/dataplane/dpshim/dpshim.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. 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) cns/client/client.go:383— cns/client/client.go:383-392 | cns/client/client.go:476-485 — both copies are in the same file, so extract the 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 `cns/client/client.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 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) tools/release/internal/github/github.go:456— tools/release/internal/github/github.go:456-465 | tools/release/internal/version/version.go:243-252 — 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.
Swallowed exception (caught, then discarded) telemetry/telemetrybuffer.go:143— `if readErr != 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) store/json.go:60— `if _, err := os.Stat(kvs.fileName); 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) platform/os_linux.go:50— `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:217— `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:225— `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:374— `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) npm/pkg/dataplane/policies/chain-management_linux.go:284— `if canaryErr != 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) npm/iptm/ioshim.go:74— `if err := grabIptablesFileLock(i.iptablesLockFile); 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:292— `if err := addRoutes(client.netlink, client.netioshim, client.containerVethName, routes); 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.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×8
Edited copy of a member (19 corresponding lines) npm/pkg/controlplane/translation/translatePolicy.go:341— npm/pkg/controlplane/translation/translatePolicy.go:341-366 | npm/pkg/controlplane/translation/translatePolicy.go:785-803 — 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) network/hnswrapper/hnsv1wrapper.go:18— network/hnswrapper/hnsv1wrapper.go:18-36 | network/hnswrapper/hnsv1wrapper.go:47-65 — 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) platform/windows/adapter/mellanox/mellanox.go:53— platform/windows/adapter/mellanox/mellanox.go:53-71 | platform/windows/adapter/mellanox/mellanox.go:74-93 — 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) network/network.go:274— network/network.go:274-293 | network/network.go:296-314 — 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) npm/pkg/controlplane/controllers/v1/podController.go:132— npm/pkg/controlplane/controllers/v1/podController.go:132-152 | npm/pkg/controlplane/controllers/v2/podController.go:134-152 — 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) ipam/manager.go:163— ipam/manager.go:163-181 | network/manager.go:285-305 — 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) npm/pkg/dataplane/dpshim/dpshim.go:354— npm/pkg/dataplane/dpshim/dpshim.go:354-372 | npm/pkg/dataplane/dpshim/dpshim.go:374-395 — 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) tools/failure-agent/internal/report/report.go:190— tools/failure-agent/internal/report/report.go:190-208 | tools/failure-agent/internal/weekly/weekly.go:281-299 — 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 (16 corresponding lines) · ×8
Edited copy of a member (16 corresponding lines) npm/cmd/main.go:51— npm/cmd/main.go:51-70 | tools/acncli/main.go:37-52 — 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) iptables/iptables.go:179— iptables/iptables.go:179-194 | iptables/iptables.go:204-219 — 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) REDACTED:300— REDACTED:300-317 | network/transparent_endpointclient_linux.go:309-324 — 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) cns/cni-telemetry-sidecar/configmanager.go:98— cns/cni-telemetry-sidecar/configmanager.go:98-113 | cns/configuration/configuration.go:134-150 — 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) telemetry/telemetry.go:105— telemetry/telemetry.go:105-123 | telemetry/telemetry.go:139-154 — 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) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:111— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:111-128 | npm/pkg/controlplane/controllers/v2/namespaceController.go:116-131 — 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) cns/restserver/ipam.go:535— cns/restserver/ipam.go:535-550 | cns/restserver/ipam.go:552-570 — 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) ipam/manager.go:328— ipam/manager.go:328-343 | network/manager.go:631-646 — 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.
Duplicated block (14 lines × 2) cns/client/client.go:194— cns/client/client.go:194-207 | cns/client/client.go:246-259 — both copies are in the same file, so extract the 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) cns/restserver/api.go:221— cns/restserver/api.go:221-234 | cns/restserver/api.go:324-337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/restserver/api.go:221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) network/hnswrapper/hnsv2wrapperfake.go:110— network/hnswrapper/hnsv2wrapperfake.go:110-123 | network/hnswrapper/hnsv2wrapperfake.go:138-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 `network/hnswrapper/hnsv2wrapperfake.go:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:381— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:381-394 | npm/pkg/controlplane/controllers/v2/namespaceController.go:416-429 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `npm/pkg/controlplane/controllers/v1/nameSpaceController.go:381` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `npm/pkg/controlplane/controllers/v1/nameSpaceController.go:398` calls `Infof` and `npm/pkg/controlplane/controllers/v2/namespaceController.go:435` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:101— npm/pkg/controlplane/controllers/v1/podController.go:101-114 | npm/pkg/controlplane/controllers/v2/podController.go:103-116 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/podController.go:101` 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 before the matched lines, `npm/pkg/controlplane/controllers/v1/podController.go:99` calls `Infof`, `GetObjectMeta`, `GetUID` and `npm/pkg/controlplane/controllers/v2/podController.go:102` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:176— npm/pkg/controlplane/controllers/v1/podController.go:176-189 | npm/pkg/controlplane/controllers/v2/podController.go:176-189 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/podController.go:176` 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) cni/network/plugin/main.go:192— cni/network/plugin/main.go:192-205 | cni/network/stateless/main.go:169-182 — `cni/network/plugin/main.go` and `cni/network/stateless/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 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) npm/pkg/dataplane/policies/chain-management_linux.go:398— npm/pkg/dataplane/policies/chain-management_linux.go:398-411 | npm/pkg/dataplane/policies/chain-management_linux.go:422-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/dataplane/policies/chain-management_linux.go:398` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) cns/restserver/api.go:943— cns/restserver/api.go:943-948 | cns/restserver/api.go:1080-1085 — both copies are in the same file, so extract the block into 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:248— npm/pkg/controlplane/controllers/v1/translatePolicy.go:248-254 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:900-905 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:248` it does not close everything it opens, so those exact lines 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1637— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1637-1642 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1687-1692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1637` 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 (6 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1618— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1618-1623 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1646-1651 — both copies are in the same file, so extract the block into 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1626— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1626-1631 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1666-1671 — both copies are in the same file, so extract the block into 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) npm/metrics/acl_rules_linux.go:7— npm/metrics/acl_rules_linux.go:7-12 | npm/metrics/acls_windows.go:6-11 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) cns/restserver/ipam.go:481— cns/restserver/ipam.go:481-486 | cns/restserver/ipam.go:518-523 — both copies are in the same file, so extract the 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 `cns/restserver/ipam.go:481` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) npm/pkg/dataplane/debug/converter.go:101— npm/pkg/dataplane/debug/converter.go:101-106 | npm/pkg/dataplane/debug/converter.go:121-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/dataplane/debug/converter.go:101` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
FixmeComment npm/pkg/dataplane/policies/policymanager_windows.go:354— // FIXME rulesToRemove is a list of pointers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment npm/pkg/dataplane/policies/policymanager_windows.go:419— // FIXME epBuilder.aclPolicies is a list of pointers — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment npm/pkg/dataplane/policies/policymanager_windows.go:472— // FIXME a lot of prints — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment npm/pkg/dataplane/ipsets/ipsetmanager_windows_test.go:104— // FIXME because this can flake, commenting this out until we refactor with new windows testing framework — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment npm/pkg/dataplane/ipsets/ipsetmanager_windows_test.go:269— // FIXME commenting this out until we refactor with new windows testing framework — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment network/network_windows.go:104— // FixMe: Find a better way to check if a nic that is selected is not part of a vSwitch — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment network/hnswrapper/hnsv2wrapperfake.go:574— // FIXME should include RuleType too, but that will require updating every instance of this struct in UTs — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TooManyMethods: HTTPRestService cns/restserver/restserver.go:98— TooManyMethods — 169 methods, declared across 14 files: restserver/ipam.go (51), restserver/util.go (33), restserver/api.go (32), restserver/internalapi.go (21), +10 more file(s). The bar is 30 methods; this is 139 over it, 5.63× 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: networkManager network/manager.go:85— TooManyMethods — 66 methods, declared across 6 files: network/manager.go (28), network/network_linux.go (17), network/network.go (11), network/network_windows.go (7), +2 more file(s). The bar is 30 methods; this is 36 over it, 2.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: IPSetManager npm/pkg/dataplane/ipsets/ipsetmanager.go:44— TooManyMethods — 51 methods, declared across 3 files: ipsets/ipsetmanager.go (27), ipsets/ipsetmanager_linux.go (16), ipsets/ipsetmanager_windows.go (8). The bar is 30 methods; this is 21 over it, 1.70× 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: PolicyManager npm/pkg/dataplane/policies/policymanager.go:60— TooManyMethods — 40 methods, declared across 4 files: policies/chain-management_linux.go (13), policies/policymanager.go (11), policies/policymanager_linux.go (9), policies/policymanager_windows.go (7). The bar is 30 methods; this is 10 over it, 1.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: DataPlane npm/pkg/dataplane/dataplane.go:58— TooManyMethods — 33 methods, declared across 3 files: dataplane/dataplane.go (23), dataplane/dataplane_linux.go (5), dataplane/dataplane_windows.go (5). The bar is 30 methods; this is 3 over it, 1.10× 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: TransparentVlanEndpointClient network/transparent_vlan_endpointclient_linux.go:81— TooManyMethods — 32 methods, declared across 2 files: network/transparent_vlan_endpointclient_linux.go (23), network/transparent_vlan_endpoint_snatroute_linux.go (9). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DPShim npm/pkg/dataplane/dpshim/dpshim.go:27— 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.
FunctionTooLong: controllers.translateEgress npm/pkg/controlplane/controllers/v1/translatePolicy.go:880— FunctionTooLong — translateEgress runs 521 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 421 over it, 5.21× 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: controllers.translateIngress npm/pkg/controlplane/controllers/v1/translatePolicy.go:226— FunctionTooLong — translateIngress runs 519 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 419 over it, 5.19× 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: main.main cns/service/main.go:498— FunctionTooLong — main runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: main.InitializeCRDState cns/service/main.go:1411— FunctionTooLong — InitializeCRDState runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: mock.NewClient cns/middlewares/mock/mockClient.go:27— FunctionTooLong — NewClient 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: main.start REDACTED:72— FunctionTooLong — start runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×6
Edited copy of a member (9 corresponding lines) log/logger.go:212— log/logger.go:212-220 | log/logger.go:223-231 — 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) network/snat/snat_linux.go:136— network/snat/snat_linux.go:136-144 | network/snat/snat_linux.go:147-155 — 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) npm/pkg/dataplane/parse/parser.go:275— npm/pkg/dataplane/parse/parser.go:275-285 | npm/pkg/dataplane/parse/parser.go:323-331 — 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) REDACTED:174— REDACTED:174-182 | network/transparent_endpointclient_linux.go:197-205 — 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) network/ovsinfravnet/infravnet_linux.go:107— network/ovsinfravnet/infravnet_linux.go:107-115 | network/snat/snat_linux.go:158-166 — 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) REDACTED:184— REDACTED:184-192 | network/transparent_endpointclient_linux.go:207-215 — 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.
Duplicated block (16 lines × 2) cns/client/client.go:662— cns/client/client.go:662-677 | cns/client/client.go:1053-1068 — both copies are in the same file, so extract the 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 `cns/client/client.go:662` 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) netlink/link_linux.go:221— netlink/link_linux.go:221-236 | netlink/link_linux.go:358-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `netlink/link_linux.go:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:377— npm/pkg/controlplane/controllers/v1/translatePolicy.go:377-392 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1027-1042 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:377` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:487— npm/pkg/controlplane/controllers/v1/translatePolicy.go:487-502 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1143-1158 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:487` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:960— npm/pkg/controlplane/controllers/v1/translatePolicy.go:960-975 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1039-1054 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:960` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) npm/pkg/dataplane/ipsets/ipsetmanager.go:286— npm/pkg/dataplane/ipsets/ipsetmanager.go:286-301 | npm/pkg/dataplane/ipsets/ipsetmanager.go:325-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/dataplane/ipsets/ipsetmanager.go:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
X28 · Index access outside its own emptiness guard· Index access outside its own emptiness guard · ×6
Index access outside its own emptiness guard platform/os_windows.go:547— `parts` holds what `Split` returns, and `parts[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(parts)` (or nil) first, as the other call site does.
Index access outside its own emptiness guard npm/pkg/dataplane/debug/trafficanalyzer.go:455— `ret` holds what `Split` returns, and `ret[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(ret)` (or nil) first, as the other call site does.
Index access outside its own emptiness guard npm/pkg/dataplane/debug/trafficanalyzer.go:460— `ret` holds what `Split` returns, and `ret[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(ret)` (or nil) first, as the other call site does.
Index access outside its own emptiness guard cns/routes/routes_windows.go:71— `strings.Split(routeTable[1], " ")[1]` takes element 1 of what `Split` returns without checking its length, and this file tests that same result elsewhere before indexing it — the result can be nil or shorter. Here a short result panics with `index out of range`. Assign it and test `len` (or nil) first, as the other call site does.
Index access outside its own emptiness guard cns/routes/routes_windows.go:69— `routePrint` holds what `Split` returns, and `routePrint[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(routePrint)` (or nil) first, as the other call site does.
Index access outside its own emptiness guard cns/routes/routes_windows.go:71— `routeTable` holds what `Split` returns, and `routeTable[1]` takes element 1 of it without checking its length — while this file tests that same result elsewhere before indexing it, because it can be nil or shorter. Here a short result panics with `index out of range`. Test `len(routeTable)` (or nil) first, as the other call site does.
Hotspot: cns/service/main.go cns/service/main.go:498— cns/service/main.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in main.main at line 498. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- cns/service/main.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: cns/restserver/util.go cns/restserver/util.go:212— cns/restserver/util.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in HTTPRestService.saveNetworkContainerGoalStateUntransacted at line 212. 4 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- cns/restserver/util.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: npm/pkg/controlplane/translation/translatePolicy.go npm/pkg/controlplane/translation/translatePolicy.go:450— npm/pkg/controlplane/translation/translatePolicy.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in translation.translateRule at line 450. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- npm/pkg/controlplane/translation/translatePolicy.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: tools/failure-agent/main.go tools/failure-agent/main.go:177— tools/failure-agent/main.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in main.run at line 177. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- tools/failure-agent/main.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: cns/middlewares/k8sSwiftV2_linux.go cns/middlewares/k8sSwiftV2_linux.go:119— cns/middlewares/k8sSwiftV2_linux.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in K8sSWIFTv2Middleware.IPConfigsRequestHandlerWrapper at line 119. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- cns/middlewares/k8sSwiftV2_linux.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.
MethodTooLong: NetPlugin.Add cni/network/network.go:397— MethodTooLong — Add runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: network.newEndpointImpl REDACTED:53— MethodTooLong — newEndpointImpl runs 143 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NetPlugin.Delete cni/network/network.go:1045— MethodTooLong — Delete runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NetPlugin.Update cni/network/network.go:1255— MethodTooLong — Update runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HTTPRestService.unpublishNetworkContainer cns/restserver/api.go:1073— MethodTooLong — unpublishNetworkContainer runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×5
Edited copy of a member (23 corresponding lines) network/transparent_endpointclient_linux.go:139— network/transparent_endpointclient_linux.go:139-171 | network/transparent_endpointclient_linux.go:173-195 — 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) network/networkutils/networkutils_linux.go:157— network/networkutils/networkutils_linux.go:157-179 | network/networkutils/networkutils_linux.go:187-209 — 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) REDACTED:44— REDACTED:44-70 | REDACTED:27-49 — 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) npm/pkg/dataplane/policies/policymanager_linux.go:45— npm/pkg/dataplane/policies/policymanager_linux.go:45-67 | npm/pkg/dataplane/policies/policymanager_linux.go:69-98 — 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) ipam/manager.go:278— ipam/manager.go:278-300 | ipam/manager.go:346-374 — 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) · ×5
Edited copy of a member (18 corresponding lines) cns/logger/cnslogger.go:181— cns/logger/cnslogger.go:181-198 | cns/logger/cnslogger.go:200-217 — 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) npm/ipsm/ipsm.go:79— npm/ipsm/ipsm.go:79-96 | npm/ipsm/ipsm.go:98-115 — 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) npm/pkg/dataplane/debug/converter.go:219— npm/pkg/dataplane/debug/converter.go:219-236 | npm/pkg/dataplane/debug/converter.go:239-256 — 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) npm/iptm/iptm.go:402— npm/iptm/iptm.go:402-419 | npm/iptm/iptm.go:465-482 — 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) tools/release/internal/version/version.go:135— tools/release/internal/version/version.go:135-153 | tools/release/internal/version/version.go:155-172 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×5
Edited copy of a member (20 corresponding lines) ipam/ipv6Ipam.go:126— ipam/ipv6Ipam.go:126-148 | REDACTED:211-230 — 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) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:79— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:79-100 | npm/pkg/controlplane/controllers/v2/namespaceController.go:87-106 — 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) npm/pkg/dataplane/dataplane.go:253— npm/pkg/dataplane/dataplane.go:253-272 | npm/pkg/dataplane/dataplane.go:276-295 — 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) nmagent/requests.go:349— nmagent/requests.go:349-368 | nmagent/requests.go:464-484 — 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) network/policy/policy_windows.go:441— network/policy/policy_windows.go:441-460 | network/policy/policy_windows.go:463-482 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×5
Edited copy of a member (21 corresponding lines) network/hnswrapper/hnsv2wrapperwithtimeout.go:323— network/hnswrapper/hnsv2wrapperwithtimeout.go:323-343 | network/hnswrapper/hnsv2wrapperwithtimeout.go:346-367 — 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) network/hnswrapper/hnsv1wrapperwithtimeout.go:189— network/hnswrapper/hnsv1wrapperwithtimeout.go:189-209 | network/hnswrapper/hnsv1wrapperwithtimeout.go:211-231 — 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) npm/pkg/dataplane/dpshim/dpshim.go:508— npm/pkg/dataplane/dpshim/dpshim.go:508-528 | npm/pkg/dataplane/dpshim/dpshim.go:557-577 — 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) network/hnswrapper/hnsv2wrapperfake.go:471— network/hnswrapper/hnsv2wrapperfake.go:471-491 | network/hnswrapper/hnsv2wrapperfake.go:525-552 — 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) aitelemetry/telemetrywrapper.go:56— aitelemetry/telemetrywrapper.go:56-76 | cni/telemetry/service/telemetrymain.go:77-101 — 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 (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) network/hnswrapper/hnsv2wrapperfake.go:376— network/hnswrapper/hnsv2wrapperfake.go:376-388 | npm/pkg/dataplane/ipsets/dirtycache.go:225-235 — 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) cns/middlewares/k8sSwiftV2.go:214— cns/middlewares/k8sSwiftV2.go:214-224 | cns/middlewares/k8sSwiftV2.go:256-268 — 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) npm/pkg/controlplane/controllers/v1/podController.go:65— npm/pkg/controlplane/controllers/v1/podController.go:65-75 | npm/pkg/controlplane/controllers/v2/podController.go:70-80 — 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) network/manager.go:749— network/manager.go:749-760 | network/manager_mock.go:86-96 — 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) npm/pkg/controlplane/controllers/v1/parseSelector.go:82— npm/pkg/controlplane/controllers/v1/parseSelector.go:82-92 | REDACTED:233-243 — 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 (17 lines × 2) cns/client/client.go:416— cns/client/client.go:416-432 | cns/client/client.go:517-533 — both copies are in the same file, so extract the 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 `cns/client/client.go:416` 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, `cns/client/client.go:414` calls `Close` and `cns/client/client.go:515` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) network/hnswrapper/hnsv1wrapperwithtimeout.go:129— network/hnswrapper/hnsv1wrapperwithtimeout.go:129-145 | network/hnswrapper/hnsv1wrapperwithtimeout.go:151-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `network/hnswrapper/hnsv1wrapperwithtimeout.go:129` it does not close everything it opens, so those 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) npm/pkg/controlplane/controllers/v1/podController.go:47— npm/pkg/controlplane/controllers/v1/podController.go:47-63 | npm/pkg/controlplane/controllers/v2/podController.go:52-68 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. 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) npm/pkg/controlplane/controllers/v1/podController.go:155— npm/pkg/controlplane/controllers/v1/podController.go:155-171 | npm/pkg/controlplane/controllers/v2/podController.go:155-171 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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.
Duplicated block (17 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:572— npm/pkg/controlplane/controllers/v1/podController.go:572-588 | npm/pkg/controlplane/controllers/v2/podController.go:650-666 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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.
Duplicated block (22 lines × 2) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:131— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:131-152 | npm/pkg/controlplane/controllers/v2/namespaceController.go:134-155 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `npm/pkg/controlplane/controllers/v1/nameSpaceController.go:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:457— npm/pkg/controlplane/controllers/v1/podController.go:457-478 | npm/pkg/controlplane/controllers/v2/podController.go:520-541 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/podController.go:457` 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 (22 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1085— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1085-1106 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1119-1140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1085` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) log/logger_linux.go:33— log/logger_linux.go:33-54 | log/logger_windows.go:28-49 — before extracting anything, compare `log/logger_linux.go` and `log/logger_windows.go` as WHOLE FILES: 96% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the 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 `log/logger_linux.go:33` 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 before the matched lines, `log/logger_linux.go:31` calls `New` and `log/logger_windows.go:26` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:581— npm/pkg/controlplane/controllers/v1/translatePolicy.go:581-594 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:691-704 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:813-826 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:581` 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 × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1177— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1177-1190 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1279-1292 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1392-1405 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1177` it does not close everything it opens, so those exact lines 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) npm/pkg/controlplane/controllers/v2/namespaceController.go:163— npm/pkg/controlplane/controllers/v2/namespaceController.go:163-178 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:147-160 | npm/pkg/controlplane/controllers/v2/podController.go:191-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. 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 × 3) cns/client/client.go:664— cns/client/client.go:664-677 | cns/client/client.go:961-974 | cns/client/client.go:1055-1068 — all 3 copies are in the same file, so extract the block into one function there and call 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 `cns/client/client.go:664` 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 (5 lines × 2) cns/imds/client.go:126— cns/imds/client.go:126-130 | cns/imds/client.go:195-200 — both copies are in the same file, so extract the 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 `cns/imds/client.go:126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) cni/network/invoker_cns.go:396— cni/network/invoker_cns.go:396-400 | cni/network/invoker_cns.go:417-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) npm/pkg/dataplane/debug/converter.go:110— npm/pkg/dataplane/debug/converter.go:110-114 | npm/pkg/dataplane/debug/converter.go:130-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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/dataplane/debug/converter.go:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:88— cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:88-92 | cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:197-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Low cohesion: HTTPRestService (LCOM4 10) cns/restserver/restserver.go:98— HTTPRestService's methods fall into 10 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 10 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: WireserverProxyFake (LCOM4 4) cns/fakes/wireserverproxyfake.go:12— WireserverProxyFake's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: NetworkUtils (LCOM4 4) network/networkutils/networkutils_linux.go:55— NetworkUtils's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: InstallerConfig (LCOM4 4) tools/acncli/installer/install.go:14— InstallerConfig's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
ClassTooLong: NetPlugin cni/network/network.go:102— ClassTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 19 blocks, lines 102-1544. The bar is 400 significant lines; this is 326 over it, 1.82× 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: Client cns/client/client.go:76— ClassTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods, 26 blocks, lines 76-1221. The bar is 400 significant lines; this is 194 over it, 1.49× 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: main cns/service/main.go:95— ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 31 over it, 1.08× 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 (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) cns/client/client.go:395— cns/client/client.go:395-432 | cns/client/client.go:488-533 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) platform/os_windows.go:331— platform/os_windows.go:331-368 | platform/os_windows.go:370-407 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (38 corresponding lines) npm/pkg/dataplane/ipsets/ipsetmanager.go:285— npm/pkg/dataplane/ipsets/ipsetmanager.go:285-322 | npm/pkg/dataplane/ipsets/ipsetmanager.go:324-372 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×3
Edited copy of a member (31 corresponding lines) cns/imds/client.go:137— cns/imds/client.go:137-167 | cns/imds/client.go:169-205 — 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) network/policy/policy_windows.go:166— network/policy/policy_windows.go:166-196 | network/policy/policy_windows.go:348-385 — 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) cns/hnsclient/hnsclient_windows.go:642— cns/hnsclient/hnsclient_windows.go:642-672 | cns/hnsclient/hnsclient_windows.go:675-706 — 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 (24 corresponding lines) · ×3
Edited copy of a member (24 corresponding lines) network/policy/policy_windows.go:198— network/policy/policy_windows.go:198-222 | network/policy/policy_windows.go:485-508 — 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) cni/ipam/ipam.go:63— cni/ipam/ipam.go:63-88 | cni/network/network.go:174-197 — 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) tools/release/internal/pipeline/pipeline.go:118— tools/release/internal/pipeline/pipeline.go:118-141 | tools/release/internal/pipeline/pipeline.go:176-199 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×3
Edited copy of a member (14 corresponding lines) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:99— npm/pkg/controlplane/controllers/v1/networkPolicyController.go:99-112 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:72-85 — 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) network/network_linux.go:280— network/network_linux.go:280-294 | network/network_linux.go:321-334 — 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) nmagent/ipaddress.go:16— nmagent/ipaddress.go:16-29 | nmagent/macaddress.go:29-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.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×3
Edited copy of a member (12 corresponding lines) network/hnswrapper/hnsv2wrapperfake.go:257— network/hnswrapper/hnsv2wrapperfake.go:257-268 | network/hnswrapper/hnsv2wrapperfake.go:271-284 — 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) cns/hnsclient/hnsclient_windows.go:355— cns/hnsclient/hnsclient_windows.go:355-366 | common/utils.go:110-121 — 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) network/hnswrapper/hnsv2wrapperfake.go:564— network/hnswrapper/hnsv2wrapperfake.go:564-575 | npm/pkg/dataplane/policies/policy_windows.go:42-54 — 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 (20 lines × 2) aitelemetry/telemetrywrapper.go:197— aitelemetry/telemetrywrapper.go:197-216 | aitelemetry/telemetrywrapper.go:237-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 `aitelemetry/telemetrywrapper.go:197` 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 (20 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:306— npm/pkg/controlplane/controllers/v1/podController.go:306-325 | npm/pkg/controlplane/controllers/v2/podController.go:333-352 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/podController.go:306` 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 (20 lines × 2) bpf-prog/ipv6-hp-bpf/pkg/egress/egress.go:20— bpf-prog/ipv6-hp-bpf/pkg/egress/egress.go:20-39 | bpf-prog/ipv6-hp-bpf/pkg/ingress/ingress.go:20-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 `bpf-prog/ipv6-hp-bpf/pkg/egress/egress.go:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) cns/client/client.go:1160— cns/client/client.go:1160-1179 | cns/client/client.go:1195-1213 — both copies are in the same file, so extract the 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–20 lines × 2) cns/kubecontroller/nodenetworkconfig/conversion_linux.go:35— cns/kubecontroller/nodenetworkconfig/conversion_linux.go:35-53 | cns/kubecontroller/nodenetworkconfig/conversion_windows.go:44-63 — 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 `cns/kubecontroller/nodenetworkconfig/conversion_linux.go:35` it does not close everything it opens, so those exact lines 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–20 lines × 2) cns/restserver/api.go:746— cns/restserver/api.go:746-765 | cns/restserver/internalapi.go:555-573 — 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 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) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:125— npm/pkg/controlplane/controllers/v1/networkPolicyController.go:125-143 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:98-116 — `npm/pkg/controlplane/controllers/v1/networkPolicyController.go` and `npm/pkg/controlplane/controllers/v2/networkPolicyController.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 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:784— npm/pkg/controlplane/controllers/v1/translatePolicy.go:784-802 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1440-1458 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:784` 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 (19 lines × 2) tools/acncli/cmd/cni/manager.go:12— tools/acncli/cmd/cni/manager.go:12-30 | tools/acncli/cmd/manager.go:12-30 — before extracting anything, compare `tools/acncli/cmd/cni/manager.go` and `tools/acncli/cmd/manager.go` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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) network/policy/policy_windows.go:176— network/policy/policy_windows.go:176-190 | network/policy/policy_windows.go:360-374 — both copies are in the same file, so extract the 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 `network/policy/policy_windows.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 (15 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:615— npm/pkg/controlplane/controllers/v1/translatePolicy.go:615-629 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1270-1284 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:615` it does not close everything it opens, so those exact lines 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:820— npm/pkg/controlplane/controllers/v1/translatePolicy.go:820-834 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1476-1490 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:820` 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 × 5) npm/pkg/controlplane/controllers/v1/translatePolicy.go:308— npm/pkg/controlplane/controllers/v1/translatePolicy.go:308-316 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:387-395 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:522-530 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:625-633 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:737-745 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:308` it does not close everything it opens, so those exact lines 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:958— npm/pkg/controlplane/controllers/v1/translatePolicy.go:958-966 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1037-1045 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1178-1186 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1280-1288 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1393-1401 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:958` it does not close everything it opens, so those exact lines 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) cns/logger/v2/config.go:30— cns/logger/v2/config.go:30-38 | cns/logger/v2/cores/ai.go:30-38 | cns/logger/v2/cores/etw_windows.go:27-35 | cns/logger/v2/cores/file.go:28-36 | cns/logger/v2/cores/stdout.go:26-34 — 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 `cns/logger/v2/config.go:30` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 3) cns/client/client.go:317— cns/client/client.go:317-323 | cns/client/client.go:403-409 | cns/client/client.go:496-502 — all 3 copies are in the same file, so extract the block into one function there and call 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 `cns/client/client.go:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crd/clustersubnetstate/embed.go:19— crd/clustersubnetstate/embed.go:19-25 | crd/nodenetworkconfig/embed.go:19-25 | crd/overlayextensionconfig/embed.go:20-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) cns/restserver/api.go:394— cns/restserver/api.go:394-400 | cns/restserver/api.go:406-412 | cns/restserver/api.go:418-424 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Outbound HTTP without resilience cns/dockerclient/dockerclient.go:49— `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 cns/dockerclient/dockerclient.go:116— `http.Post(` 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 cns/dockerclient/dockerclient.go:162— `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.
Deprecated module: github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets — `github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets` is required at v0.12.0 in REDACTED, and its author has DEPRECATED the module: "use github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets 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.
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.
PodController.syncAddAndUpdatePod (cognitive 28) npm/pkg/controlplane/controllers/v1/podController.go:371— PodController.syncAddAndUpdatePod has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PodController.syncAddAndUpdatePod (cognitive 28) npm/pkg/controlplane/controllers/v2/podController.go:419— PodController.syncAddAndUpdatePod has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetworkPolicyController.syncNetPol (cognitive 20) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:235— NetworkPolicyController.syncNetPol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 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.
NetworkPolicyController.syncNetPol (cognitive 20) npm/pkg/controlplane/controllers/v2/networkPolicyController.go:210— NetworkPolicyController.syncNetPol has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 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.
TooManyFields: EndpointInfo network/endpoint.go:65— TooManyFields — 49 stored fields beside 3 methods. The bar is 30 stored fields; this is 19 over it, 1.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CNSConfig cns/configuration/configuration.go:25— TooManyFields — 47 stored fields beside 1 method. The bar is 30 stored fields; this is 17 over it, 1.57× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×2
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×2
Edited copy of a member (43 corresponding lines) REDACTED:327— REDACTED:327-370 | REDACTED:372-414 — 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.
Edited copy of a member (43 corresponding lines) npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:458— npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:458-504 | npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:507-549 — 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 copy of a member (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) cns/client/client.go:1111— cns/client/client.go:1111-1145 | cns/client/client.go:1190-1221 — 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) log/logger_linux.go:20— log/logger_linux.go:20-54 | log/logger_windows.go:18-49 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×2
Edited copy of a member (26 corresponding lines) network/snat/snat_linux.go:255— network/snat/snat_linux.go:255-280 | network/snat/snat_linux.go:353-378 — 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) npm/ipsm/ipsm.go:228— npm/ipsm/ipsm.go:228-253 | npm/ipsm/ipsm.go:256-290 — 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 (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) npm/pkg/dataplane/dpshim/dpshim.go:155— npm/pkg/dataplane/dpshim/dpshim.go:155-184 | npm/pkg/dataplane/dpshim/dpshim.go:186-222 — 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) npm/pkg/controlplane/controllers/v1/podController.go:82— npm/pkg/controlplane/controllers/v1/podController.go:82-114 | npm/pkg/controlplane/controllers/v2/podController.go:87-116 — 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 copy of a member (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:145— npm/pkg/controlplane/controllers/v1/networkPolicyController.go:145-174 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:118-145 — 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) npm/pkg/controlplane/translation/translatePolicy.go:612— npm/pkg/controlplane/translation/translatePolicy.go:612-639 | npm/pkg/controlplane/translation/translatePolicy.go:655-685 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) netlink/link_linux.go:167— netlink/link_linux.go:167-188 | netlink/link_linux.go:191-215 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) tools/release/cmd/release-cli/main.go:183— tools/release/cmd/release-cli/main.go:183-206 | tools/release/cmd/release-cli/main.go:208-229 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×2
Edited copy of a member (6 corresponding lines) cni/network/network_linux.go:22— cni/network/network_linux.go:22-28 | cni/network/network_linux.go:30-35 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) cns/kubecontroller/multitenantpodnetworkconfig/reconciler.go:13— cns/kubecontroller/multitenantpodnetworkconfig/reconciler.go:13-18 | cns/kubecontroller/nicnetworkconfig/reconciler.go:16-21 — 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 (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) network/hnswrapper/hnsv2wrapperfake.go:463— network/hnswrapper/hnsv2wrapperfake.go:463-469 | network/hnswrapper/hnsv2wrapperfake.go:516-523 — 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) cns/restserver/endpoint_delete_intent.go:118— cns/restserver/endpoint_delete_intent.go:118-124 | npm/pkg/dataplane/testutils/utils_windows.go:19-25 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×2
Edited copy of a member (10 corresponding lines) cns/restserver/api.go:1234— cns/restserver/api.go:1234-1243 | cns/restserver/api.go:1249-1258 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crd/multitenancy/api/v1alpha1/groupversion_info.go:14— crd/multitenancy/api/v1alpha1/groupversion_info.go:14-23 | crd/multitenantnetworkcontainer/api/v1alpha1/groupversion_info.go:14-23 — 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 copies of one member (4 members, 21+ corresponding lines) · ×2
Edited copies of one member (4 members, 21+ corresponding lines) ipam/manager.go:303— ipam/manager.go:303-325 | ipam/manager.go:377-404 | network/manager.go:677-702 | network/manager.go:705-725 — 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) tools/azure-npm-to-cilium-validator/azure-npm-to-cilium-validator.go:350— tools/azure-npm-to-cilium-validator/azure-npm-to-cilium-validator.go:350-372 | tools/azure-npm-to-cilium-validator/azure-npm-to-cilium-validator.go:383-405 | tools/azure-npm-to-cilium-validator/azure-npm-to-cilium-validator.go:417-437 | tools/azure-npm-to-cilium-validator/azure-npm-to-cilium-validator.go:449-470 — 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 copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) platform/windows/adapter/mellanox/mellanox.go:97— platform/windows/adapter/mellanox/mellanox.go:97-113 | platform/windows/adapter/mellanox/mellanox.go:117-136 — 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) network/ovs_endpoint_snatroute_linux.go:23— network/ovs_endpoint_snatroute_linux.go:23-39 | network/transparent_vlan_endpoint_snatroute_linux.go:11-27 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) npm/pkg/controlplane/controllers/v1/podController.go:116— npm/pkg/controlplane/controllers/v1/podController.go:116-130 | npm/pkg/controlplane/controllers/v2/podController.go:118-132 — 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) tools/acncli/cmd/cni/cni.go:13— tools/acncli/cmd/cni/cni.go:13-27 | tools/acncli/cmd/npm/npm.go:19-34 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (18 lines × 2) REDACTED:104— REDACTED:104-121 | REDACTED:80-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:104` 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:79` calls `Errorf` and `REDACTED:103` 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 × 2) npm/pkg/controlplane/controllers/v1/parseSelector.go:239— npm/pkg/controlplane/controllers/v1/parseSelector.go:239-256 | npm/pkg/controlplane/translation/parseSelector.go:126-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. 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 (16 lines × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:318— npm/pkg/controlplane/controllers/v1/translatePolicy.go:318-333 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:968-983 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1294-1309 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1411-1426 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:310— npm/pkg/controlplane/controllers/v1/translatePolicy.go:310-325 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:389-404 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:627-642 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:739-754 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:310` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) netlink/link_linux.go:219— netlink/link_linux.go:219-233 | netlink/link_linux.go:356-370 | netlink/link_linux.go:383-397 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1236— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1236-1250 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1345-1359 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1468-1482 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1236` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) network/networkutils/networkutils_linux.go:163— network/networkutils/networkutils_linux.go:163-179 | network/networkutils/networkutils_linux.go:194-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 `network/networkutils/networkutils_linux.go:163` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–17 lines × 2) network/snat/snat_linux.go:230— network/snat/snat_linux.go:230-246 | network/snat/snat_linux.go:330-345 — both copies are in the same file, so extract the 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 `network/snat/snat_linux.go:230` it does not close everything it opens, so those exact lines 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 × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:315— npm/pkg/controlplane/controllers/v1/translatePolicy.go:315-328 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:394-407 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:965-978 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1044-1057 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:315` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:531— npm/pkg/controlplane/controllers/v1/translatePolicy.go:531-544 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:641-654 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:757-770 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1187-1200 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:531` it does not close everything it opens, so those exact lines 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 × 5) npm/pkg/controlplane/controllers/v1/translatePolicy.go:324— npm/pkg/controlplane/controllers/v1/translatePolicy.go:324-336 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:411-423 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:535-547 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:645-657 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:761-773 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:324` it does not close everything it opens, so those exact lines 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 × 5) npm/pkg/controlplane/controllers/v1/translatePolicy.go:974— npm/pkg/controlplane/controllers/v1/translatePolicy.go:974-986 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1061-1073 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1191-1203 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1300-1312 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1417-1429 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:974` it does not close everything it opens, so those exact lines 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 × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:460— npm/pkg/controlplane/controllers/v1/translatePolicy.go:460-471 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:580-591 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:690-701 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:812-823 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:460` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) network/hnswrapper/hnsv1wrapperwithtimeout.go:49— network/hnswrapper/hnsv1wrapperwithtimeout.go:49-60 | network/hnswrapper/hnsv1wrapperwithtimeout.go:71-82 | network/hnswrapper/hnsv1wrapperwithtimeout.go:137-148 | network/hnswrapper/hnsv1wrapperwithtimeout.go:159-170 — 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 `network/hnswrapper/hnsv1wrapperwithtimeout.go:49` 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) crd/clustersubnetstate/client.go:34— crd/clustersubnetstate/client.go:34-42 | crd/multitenancy/client.go:33-41 | crd/nodenetworkconfig/client.go:35-43 | crd/overlayextensionconfig/client.go:32-40 — 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) nmagent/client.go:65— nmagent/client.go:65-73 | nmagent/client.go:87-96 | nmagent/client.go:175-184 | nmagent/client.go:222-232 — 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 `nmagent/client.go:87` 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 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, `nmagent/client.go:63` calls `Do` and `nmagent/client.go:84` 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.
Stateful handler: Server REDACTED:23— `Server` serves requests (gRPC service methods run on a goroutine per request, and every one shares the single `Server` value the router holds) but writes its fields outside any lock (shutdownCh; e.g. `shutdownCh` in `Run` at line 50). Unsynchronised concurrent writes are a data race in Go: an update is lost or a value tears, and a concurrent map write aborts the process.
main.main (cyclomatic 104) cns/service/main.go:498— main.main has cyclomatic complexity 104 (threshold 15). Of this number, 91 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
controllers.translateIngress (cyclomatic 67) npm/pkg/controlplane/controllers/v1/translatePolicy.go:226— controllers.translateIngress has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
controllers.translateEgress (cyclomatic 67) npm/pkg/controlplane/controllers/v1/translatePolicy.go:880— controllers.translateEgress has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.InitializeCRDState (cyclomatic 43) cns/service/main.go:1411— main.InitializeCRDState has cyclomatic complexity 43 (threshold 15). Of this number, 37 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NetPlugin.Add (cyclomatic 38) cni/network/network.go:397— NetPlugin.Add has cyclomatic complexity 38 (threshold 15). Of this number, 23 points are the body's own statements and 15 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NetPlugin.Delete (cyclomatic 34) cni/network/network.go:1045— NetPlugin.Delete has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Hnsv2wrapperFake.ModifyNetworkSettings (cyclomatic 32) network/hnswrapper/hnsv2wrapperfake.go:69— Hnsv2wrapperFake.ModifyNetworkSettings has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
translation.translateRule (cyclomatic 31) npm/pkg/controlplane/translation/translatePolicy.go:450— translation.translateRule has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
multitenantoperator.ipv6Configuration (cyclomatic 30) cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:205— multitenantoperator.ipv6Configuration has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HTTPRestService.saveNetworkContainerGoalStateUntransacted (cyclomatic 30) cns/restserver/util.go:212— HTTPRestService.saveNetworkContainerGoalStateUntransacted has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
networkManager.connectExternalInterface (cyclomatic 29) network/network_linux.go:476— networkManager.connectExternalInterface has cyclomatic complexity 29 (threshold 15). Of this number, 28 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.
TransparentVlanEndpointClient.PopulateVM (cyclomatic 27) network/transparent_vlan_endpointclient_linux.go:257— TransparentVlanEndpointClient.PopulateVM has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PolicyManager.cleanupOtherIptables (cyclomatic 27) npm/pkg/dataplane/policies/chain-management_linux.go:298— PolicyManager.cleanupOtherIptables has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CNSIPAMInvoker.Add (cyclomatic 24) cni/network/invoker_cns.go:141— CNSIPAMInvoker.Add 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.
DataPlane.updatePod (cyclomatic 24) npm/pkg/dataplane/dataplane_linux.go:17— DataPlane.updatePod 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.
multiTenantCrdReconciler.Reconcile (cyclomatic 23) cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:54— multiTenantCrdReconciler.Reconcile has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTTPRestService.syncHostNCVersion (cyclomatic 23) cns/restserver/internalapi.go:188— HTTPRestService.syncHostNCVersion has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NetPlugin.Update (cyclomatic 22) cni/network/network.go:1255— NetPlugin.Update has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
observer.observeMetrics (cyclomatic 21) cns/ipampool/metrics/observer.go:85— observer.observeMetrics has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 112, 149, 94). 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.
networkManager.restore (cyclomatic 21) network/manager.go:189— networkManager.restore has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.start (cyclomatic 21) REDACTED:72— main.start has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTTPRestService.createOrUpdateNetworkContainer (cyclomatic 20) cns/restserver/api.go:519— HTTPRestService.createOrUpdateNetworkContainer 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.
azureSource.refresh (cyclomatic 20) ipam/azure.go:73— azureSource.refresh 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.
controllers.translatePolicy (cyclomatic 20) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1589— controllers.translatePolicy has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
IPSetManager.GetIPsFromSelectorIPSets (cyclomatic 20) npm/pkg/dataplane/ipsets/ipsetmanager_windows.go:55— IPSetManager.GetIPsFromSelectorIPSets 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.
TelemetryBuffer.StartServer (cyclomatic 20) telemetry/telemetrybuffer.go:93— TelemetryBuffer.StartServer has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 111). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
HTTPRestService.SyncNodeStatus (cyclomatic 19) cns/restserver/internalapi.go:46— HTTPRestService.SyncNodeStatus has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTTPRestService.getNICResources (cyclomatic 19) cns/restserver/nicresources.go:20— HTTPRestService.getNICResources has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
networkManager.configureHcnNetwork (cyclomatic 19) network/network_windows.go:223— networkManager.configureHcnNetwork has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DataPlane.addPolicies (cyclomatic 19) npm/pkg/dataplane/dataplane.go:480— DataPlane.addPolicies has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Converter.pbRuleList (cyclomatic 19) npm/pkg/dataplane/debug/converter.go:259— Converter.pbRuleList has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Program.Attach (cyclomatic 18) bpf-prog/azure-block-iptables/pkg/bpfprogram/program.go:122— Program.Attach has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
hnsclient.configureAclSettingHostNCApipaEndpoint (cyclomatic 18) cns/hnsclient/hnsclient_windows.go:390— hnsclient.configureAclSettingHostNCApipaEndpoint 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.
K8sSWIFTv2Middleware.IPConfigsRequestHandlerWrapper (cyclomatic 18) cns/middlewares/k8sSwiftV2_linux.go:119— K8sSWIFTv2Middleware.IPConfigsRequestHandlerWrapper has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 135). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
HTTPRestService.assignAvailableIPConfigsUntransacted (cyclomatic 18) cns/restserver/ipam.go:1173— HTTPRestService.assignAvailableIPConfigsUntransacted 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.
HTTPRestService.attachOrDetachHelper (cyclomatic 18) cns/restserver/util.go:768— HTTPRestService.attachOrDetachHelper 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.
NetworkPolicyController.syncAddAndUpdateNetPol (cyclomatic 18) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:325— NetworkPolicyController.syncAddAndUpdateNetPol 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.
PodController.syncAddAndUpdatePod (cyclomatic 18) npm/pkg/controlplane/controllers/v1/podController.go:371— PodController.syncAddAndUpdatePod 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.
IPSetManager.updateDirtyKernelSets (cyclomatic 18) npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:556— IPSetManager.updateDirtyKernelSets 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.
NetPlugin.createEpInfo (cyclomatic 17) cni/network/network.go:745— NetPlugin.createEpInfo 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.
HTTPRestService.assignDesiredIPConfigsUntransacted (cyclomatic 17) cns/restserver/ipam.go:1066— HTTPRestService.assignDesiredIPConfigsUntransacted 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.
PodController.syncAddAndUpdatePod (cyclomatic 17) npm/pkg/controlplane/controllers/v2/podController.go:419— PodController.syncAddAndUpdatePod 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.
debug.getHitRules (cyclomatic 17) npm/pkg/dataplane/debug/trafficanalyzer.go:219— debug.getHitRules 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.
network.configureDefaultAddResult (cyclomatic 16) cni/network/invoker_cns.go:463— network.configureDefaultAddResult 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.
AzureIPAMInvoker.Add (cyclomatic 16) cni/network/invoker_azure.go:53— AzureIPAMInvoker.Add has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Multitenancy.DetermineSnatFeatureOnHost (cyclomatic 16) cni/network/multitenancy.go:77— Multitenancy.DetermineSnatFeatureOnHost 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.
main.rootExecute (cyclomatic 16) cni/network/plugin/main.go:53— main.rootExecute has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
TelemetrySidecar.startTelemetryService (cyclomatic 16) cns/cni-telemetry-sidecar/sidecar.go:98— TelemetrySidecar.startTelemetryService 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.
main.pollNodeInfoCRDAndUpdatePlugin (cyclomatic 16) cns/service/main.go:1198— main.pollNodeInfoCRDAndUpdatePlugin 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.
addressManager.restore (cyclomatic 16) ipam/manager.go:96— addressManager.restore has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
network.newEndpointImplHnsV2 (cyclomatic 16) network/endpoint_windows.go:455— network.newEndpointImplHnsV2 has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
policy.GetHcnEndpointPolicies (cyclomatic 16) network/policy/policy_windows.go:511— policy.GetHcnEndpointPolicies 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.
IptablesManager.checkAndAddForwardChain (cyclomatic 16) npm/iptm/iptm.go:228— IptablesManager.checkAndAddForwardChain 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.
PodController.syncPod (cyclomatic 16) npm/pkg/controlplane/controllers/v2/podController.go:254— PodController.syncPod has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Hnsv2wrapperFake.ApplyEndpointPolicy (cyclomatic 16) network/hnswrapper/hnsv2wrapperfake.go:286— Hnsv2wrapperFake.ApplyEndpointPolicy 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.
D12 · Dependency Hygiene· Dependency pinned to a stale untagged commit · ×1
Dependency pinned to a stale untagged commit: github.com/fluent/fluent-bit-go — Direct dependency `github.com/fluent/fluent-bit-go` is required at `v0.0.0-20230731091245-a7a013e2473c` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-31, 3.3 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/fluent/fluent-bit-go` and has not moved this requirement in 3.3 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/fluent/fluent-bit-go` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Repeated repair: npm/pkg/controlplane/translation/parseSelector.go npm/pkg/controlplane/translation/parseSelector.go:21— npm/pkg/controlplane/translation/parseSelector.go changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is translation.flattenNameSpaceSelector at line 21), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Revert breaking NPM changes (#5030)”; “fix: [NPM] scope negation-only namespaceSelector matches to cluster namespaces (#4868)”; “fix: [NPM] compile multi-value namespaceSelector NotIn as a single conjunction (#4866)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 17:22:05 +00:00' --until='2026-11-13 17:22:05 +00:00' --full-history --no-merges -- npm/pkg/controlplane/translation/parseSelector.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.
HackComment npm/pkg/dataplane/policies/policymanager_linux_test.go:374— // hack: the cache is empty (and len(cache) != len(allTestNetworkPolicies)), so shouldDeactivate will be false — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
controllers.translateEgress (cognitive 222) npm/pkg/controlplane/controllers/v1/translatePolicy.go:880— controllers.translateEgress has cognitive complexity 222 (threshold 15). Drivers by points: if/else 35 (128 pts), loops 13 (54 pts), match/switch 5 (30 pts), boolean chains 10 (nesting depth added 159). 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.
controllers.translateIngress (cognitive 220) npm/pkg/controlplane/controllers/v1/translatePolicy.go:226— controllers.translateIngress has cognitive complexity 220 (threshold 15). Drivers by points: if/else 34 (125 pts), loops 14 (55 pts), match/switch 5 (30 pts), boolean chains 10 (nesting depth added 157). 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.
main.main (cognitive 158) cns/service/main.go:498— main.main has cognitive complexity 158 (threshold 15). Drivers by points: if/else 89 (142 pts), match/switch 4 (8 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 59). Of this number, 127 points are the body's own statements and 31 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Hnsv2wrapperFake.ModifyNetworkSettings (cognitive 94) network/hnswrapper/hnsv2wrapperfake.go:69— Hnsv2wrapperFake.ModifyNetworkSettings has cognitive complexity 94 (threshold 15). Drivers by points: if/else 20 (71 pts), loops 6 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 66). 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.
translation.translateRule (cognitive 66) npm/pkg/controlplane/translation/translatePolicy.go:450— translation.translateRule has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (54 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TelemetryBuffer.StartServer (cognitive 64) telemetry/telemetrybuffer.go:93— TelemetryBuffer.StartServer has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (56 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 38). Most of this is not in the body itself: 7 of the 64 points are its own statements and the rest belongs to one function literal inside it that branches (line 111). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
NetPlugin.Add (cognitive 60) cni/network/network.go:397— NetPlugin.Add has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (46 pts), loops 6 (9 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 22). Of this number, 33 points are the body's own statements and 27 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.restore (cognitive 55) network/manager.go:189— networkManager.restore has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 7 (24 pts), boolean chains 1 (nesting depth added 34). 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.
NetPlugin.Delete (cognitive 54) cni/network/network.go:1045— NetPlugin.Delete has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (44 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 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.
main.InitializeCRDState (cognitive 54) cns/service/main.go:1411— main.InitializeCRDState has cognitive complexity 54 (threshold 15). Drivers by points: if/else 36 (48 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 13). Of this number, 48 points are the body's own statements and 6 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.createNetwork (cognitive 53) cns/restserver/api.go:75— HTTPRestService.createNetwork has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (39 pts), match/switch 3 (14 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IPSetManager.GetIPsFromSelectorIPSets (cognitive 49) npm/pkg/dataplane/ipsets/ipsetmanager_windows.go:55— IPSetManager.GetIPsFromSelectorIPSets has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 7 (16 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyManager.cleanupOtherIptables (cognitive 46) npm/pkg/dataplane/policies/chain-management_linux.go:298— PolicyManager.cleanupOtherIptables has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (39 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 16). Of this number, 44 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.
TransparentVlanEndpointClient.PopulateVM (cognitive 45) network/transparent_vlan_endpointclient_linux.go:257— TransparentVlanEndpointClient.PopulateVM has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (45 pts) (nesting depth added 18). Of this number, 35 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Converter.pbRuleList (cognitive 45) npm/pkg/dataplane/debug/converter.go:259— Converter.pbRuleList has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (16 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.updatePod (cognitive 42) npm/pkg/dataplane/dataplane_linux.go:17— DataPlane.updatePod has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.start (cognitive 41) REDACTED:72— main.start has cognitive complexity 41 (threshold 15). Drivers by points: if/else 28 (40 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CNSIPAMInvoker.Delete (cognitive 40) cni/network/invoker_cns.go:353— CNSIPAMInvoker.Delete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
hnsclient.configureAclSettingHostNCApipaEndpoint (cognitive 40) cns/hnsclient/hnsclient_windows.go:390— hnsclient.configureAclSettingHostNCApipaEndpoint has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.connectExternalInterface (cognitive 40) network/network_linux.go:476— networkManager.connectExternalInterface has cognitive complexity 40 (threshold 15). Drivers by points: if/else 28 (38 pts), boolean chains 2 (nesting depth added 10). Of this number, 39 points are the body's own statements and 1 belongs 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.
CNSIPAMInvoker.Add (cognitive 39) cni/network/invoker_cns.go:141— CNSIPAMInvoker.Add has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azureSource.refresh (cognitive 39) ipam/azure.go:73— azureSource.refresh has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Multitenancy.DetermineSnatFeatureOnHost (cognitive 38) cni/network/multitenancy.go:77— Multitenancy.DetermineSnatFeatureOnHost has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (37 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
addressManager.restore (cognitive 38) ipam/manager.go:96— addressManager.restore has cognitive complexity 38 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 9 (16 pts), boolean chains 1 (nesting depth added 22). 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.
IPSetManager.updateDirtyKernelSets (cognitive 38) npm/pkg/dataplane/ipsets/ipsetmanager_linux.go:556— IPSetManager.updateDirtyKernelSets has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 7 (14 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.attachOrDetachHelper (cognitive 37) cns/restserver/util.go:768— HTTPRestService.attachOrDetachHelper has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 1 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
observer.observeMetrics (cognitive 35) cns/ipampool/metrics/observer.go:85— observer.observeMetrics has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 112, 94, 149). 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.
HTTPRestService.createOrUpdateNetworkContainer (cognitive 35) cns/restserver/api.go:519— HTTPRestService.createOrUpdateNetworkContainer has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 7, 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.
HTTPRestService.syncHostNCVersion (cognitive 35) cns/restserver/internalapi.go:188— HTTPRestService.syncHostNCVersion has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 5 (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.
networkManager.configureHcnNetwork (cognitive 35) network/network_windows.go:223— networkManager.configureHcnNetwork has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 3, 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.
HTTPRestService.SyncNodeStatus (cognitive 34) cns/restserver/internalapi.go:46— HTTPRestService.SyncNodeStatus has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.addPolicies (cognitive 34) npm/pkg/dataplane/dataplane.go:480— DataPlane.addPolicies has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.saveNetworkContainerGoalStateUntransacted (cognitive 33) cns/restserver/util.go:212— HTTPRestService.saveNetworkContainerGoalStateUntransacted has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
addressSpace.requestPool (cognitive 33) ipam/pool.go:292— addressSpace.requestPool has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
policy.SerializePolicies (cognitive 33) network/policy/policy_windows.go:72— policy.SerializePolicies has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.assignAvailableIPConfigsUntransacted (cognitive 32) cns/restserver/ipam.go:1173— HTTPRestService.assignAvailableIPConfigsUntransacted has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Monitor.Start (cognitive 31) cns/ipampool/monitor.go:89— Monitor.Start has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (18 pts), match/switch 3 (8 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
multiTenantCrdReconciler.Reconcile (cognitive 31) cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:54— multiTenantCrdReconciler.Reconcile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.getNICResources (cognitive 31) cns/restserver/nicresources.go:20— HTTPRestService.getNICResources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (26 pts), loops 4 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
K8sSWIFTv2Middleware.getSwiftV2IpConfigHelper (cognitive 30) cns/middlewares/k8sSwiftV2.go:101— K8sSWIFTv2Middleware.getSwiftV2IpConfigHelper has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
controllers.translatePolicy (cognitive 30) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1589— controllers.translatePolicy has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 7 (13 pts), boolean chains 2 (nesting depth added 13). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
debug.getHitRules (cognitive 30) npm/pkg/dataplane/debug/trafficanalyzer.go:219— debug.getHitRules has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (5 pts), boolean chains 4 (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.
HTTPRestService.assignDesiredIPConfigsUntransacted (cognitive 29) cns/restserver/ipam.go:1066— HTTPRestService.assignDesiredIPConfigsUntransacted has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.pollNodeInfoCRDAndUpdatePlugin (cognitive 29) cns/service/main.go:1198— main.pollNodeInfoCRDAndUpdatePlugin has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (9 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ipam.populateAddressSpace (cognitive 29) ipam/fileIpam.go:139— ipam.populateAddressSpace has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 4 (8 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Hnsv2wrapperFake.ApplyEndpointPolicy (cognitive 29) network/hnswrapper/hnsv2wrapperfake.go:286— Hnsv2wrapperFake.ApplyEndpointPolicy has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.rootExecute (cognitive 28) cni/network/plugin/main.go:53— main.rootExecute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (28 pts) (nesting depth added 12). Of this number, 24 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
K8sSWIFTv2Middleware.IPConfigsRequestHandlerWrapper (cognitive 28) cns/middlewares/k8sSwiftV2_linux.go:119— K8sSWIFTv2Middleware.IPConfigsRequestHandlerWrapper has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2, boolean chains 1 (nesting depth added 11). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 135). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
addressSpace.merge (cognitive 28) ipam/pool.go:181— addressSpace.merge has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Converter.getModulesFromRule (cognitive 28) npm/pkg/dataplane/debug/converter.go:446— Converter.getModulesFromRule has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 3 (7 pts), match/switch 2 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Fetcher.Start (cognitive 28) refresh/fetcher.go:57— Fetcher.Start has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 16). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 58). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
socket.receiveResponse (cognitive 27) netlink/socket.go:133— socket.receiveResponse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.deleteNetworkContainer (cognitive 26) cns/restserver/api.go:706— HTTPRestService.deleteNetworkContainer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.applyDNSConfig (cognitive 26) network/network_linux.go:428— networkManager.applyDNSConfig has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
IPSetManager.calculateNewSetPolicies (cognitive 26) npm/pkg/dataplane/ipsets/ipsetmanager_windows.go:257— IPSetManager.calculateNewSetPolicies has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (5 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deny-public-github-mutations.gh_authorship_denied (cognitive 26) .github/hooks/deny-public-github-mutations.py:162— deny-public-github-mutations.gh_authorship_denied has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.Attach (cognitive 25) bpf-prog/azure-block-iptables/pkg/bpfprogram/program.go:122— Program.Attach has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 2 (6 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
network.configureDefaultAddResult (cognitive 25) cni/network/invoker_cns.go:463— network.configureDefaultAddResult has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 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.
NetworkContainerRequestPolicies.Validate (cognitive 25) cns/NetworkContainerContract.go:776— NetworkContainerRequestPolicies.Validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetworkPolicyController.syncAddAndUpdateNetPol (cognitive 25) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:325— NetworkPolicyController.syncAddAndUpdateNetPol has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 6 (7 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PodController.syncPod (cognitive 25) npm/pkg/controlplane/controllers/v2/podController.go:254— PodController.syncPod has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 1 (nesting depth added 9). Of this number, 19 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoalStateProcessor.processHydrationEvent (cognitive 25) npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.go:126— GoalStateProcessor.processHydrationEvent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventsServer.start (cognitive 25) npm/pkg/transport/events_server.go:86— EventsServer.start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
network.getPoliciesFromRuntimeCfg (cognitive 24) cni/network/network_linux.go:110— network.getPoliciesFromRuntimeCfg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetworkPolicyController.createCidrsRule (cognitive 24) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:485— NetworkPolicyController.createCidrsRule has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse.parseIptablesChainObject (cognitive 24) npm/pkg/dataplane/parse/parser.go:104— parse.parseIptablesChainObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
policies.ValidatePolicy (cognitive 24) npm/pkg/dataplane/policies/policy.go:165— policies.ValidatePolicy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetPlugin.Update (cognitive 23) cni/network/network.go:1255— NetPlugin.Update has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 2). Of this number, 19 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HTTPRestService.restoreState (cognitive 23) cns/restserver/util.go:104— HTTPRestService.restoreState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (23 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.
HTTPRestService.restoreNetworkState (cognitive 23) cns/restserver/util.go:717— HTTPRestService.restoreNetworkState has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceController.syncNamespace (cognitive 23) npm/pkg/controlplane/controllers/v2/namespaceController.go:228— NamespaceController.syncNamespace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 2 (nesting depth added 8). Of this number, 17 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceController.syncUpdateNamespace (cognitive 23) npm/pkg/controlplane/controllers/v2/namespaceController.go:349— NamespaceController.syncUpdateNamespace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.RunPeriodicTasks (cognitive 23) npm/pkg/dataplane/dataplane.go:158— DataPlane.RunPeriodicTasks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (7 pts), loops 3 (4 pts) (nesting depth added 12). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 211, 182, 159). 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.
IPSetManager.AddToLists (cognitive 23) npm/pkg/dataplane/ipsets/ipsetmanager.go:374— IPSetManager.AddToLists has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MasqDaemon.mergeConfig (cognitive 22) azure-ip-masq-merger/ip_masq_merger.go:139— MasqDaemon.mergeConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 4 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.
AzureIPAMInvoker.Add (cognitive 22) cni/network/invoker_azure.go:53— AzureIPAMInvoker.Add has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2, loops 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 8 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.
common.ParseArgs (cognitive 22) common/args.go:36— common.ParseArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (4 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.DeleteState (cognitive 22) network/manager.go:778— networkManager.DeleteState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
translation.parsePodSelector (cognitive 22) npm/pkg/controlplane/translation/parseSelector.go:248— translation.parsePodSelector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AzureIPAMInvoker.Delete (cognitive 21) cni/network/invoker_azure.go:166— AzureIPAMInvoker.Delete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TelemetrySidecar.startTelemetryService (cognitive 21) cns/cni-telemetry-sidecar/sidecar.go:98— TelemetrySidecar.startTelemetryService has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reconciler.Reconcile (cognitive 21) cns/kubecontroller/nodenetworkconfig/reconciler.go:72— Reconciler.Reconcile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.ReconcileIPAssignment (cognitive 21) cns/restserver/internalapi.go:302— HTTPRestService.ReconcileIPAssignment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
addressPool.requestAddress (cognitive 21) ipam/pool.go:457— addressPool.requestAddress has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.newNetworkImplHnsV2 (cognitive 21) network/network_windows.go:375— networkManager.newNetworkImplHnsV2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OVSEndpointClient.AddSnatEndpoint (cognitive 21) network/ovs_endpoint_snatroute_linux.go:41— OVSEndpointClient.AddSnatEndpoint 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.
IpsetManager.DestroyNpmIpsets (cognitive 21) npm/ipsm/ipsm.go:589— IpsetManager.DestroyNpmIpsets has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IptablesManager.checkAndAddForwardChain (cognitive 21) npm/iptm/iptm.go:228— IptablesManager.checkAndAddForwardChain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hnsclient.GetHNSEndpointbyIP (cognitive 20) cns/hnsclient/hnsclient_windows.go:764— hnsclient.GetHNSEndpointbyIP has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.MarkIpsAsAvailableUntransacted (cognitive 20) cns/restserver/ipam.go:796— HTTPRestService.MarkIpsAsAvailableUntransacted has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cns.endpointStateToPodInfoByIP (cognitive 20) cns/stateprovider/cns/podinfoprovider.go:40— cns.endpointStateToPodInfoByIP has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DHCP.receiveDHCPResponse (cognitive 20) dhcp/dhcp_linux.go:307— DHCP.receiveDHCPResponse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 317). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
translation.flattenNameSpaceSelector (cognitive 20) npm/pkg/controlplane/translation/parseSelector.go:21— translation.flattenNameSpaceSelector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Converter.getCacheFromBytes (cognitive 20) npm/pkg/dataplane/debug/converter.go:98— Converter.getCacheFromBytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (20 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.
dptestutils.VerifyACLs (cognitive 20) npm/pkg/dataplane/testutils/utils_windows.go:110— dptestutils.VerifyACLs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TelemetryBuffer.ConnectToTelemetryService (cognitive 20) telemetry/telemetrybuffer.go:359— TelemetryBuffer.ConnectToTelemetryService has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nodenetworkconfig.createNCRequestFromStaticNCHelper (cognitive 19) cns/kubecontroller/nodenetworkconfig/conversion_linux.go:15— nodenetworkconfig.createNCRequestFromStaticNCHelper has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.getHostLocalIP (cognitive 19) cns/restserver/api.go:340— HTTPRestService.getHostLocalIP has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.MarkNIPsPendingRelease (cognitive 19) cns/restserver/ipam.go:726— HTTPRestService.MarkNIPsPendingRelease has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (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.
ipv6IpamSource.refresh (cognitive 19) ipam/ipv6Ipam.go:150— ipv6IpamSource.refresh has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (6 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.GetEndpointState (cognitive 19) network/manager.go:467— networkManager.GetEndpointState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
network.getEndpointWithVFDevice (cognitive 19) network/endpoint_windows.go:73— network.getEndpointWithVFDevice has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
policy.GetHcnEndpointPolicies (cognitive 19) network/policy/policy_windows.go:511— policy.GetHcnEndpointPolicies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
controllers.deductPolicy (cognitive 19) npm/pkg/controlplane/controllers/v1/parsePolicy.go:85— controllers.deductPolicy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PodController.syncPod (cognitive 19) npm/pkg/controlplane/controllers/v1/podController.go:250— PodController.syncPod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (19 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.createIPSetsAndReferences (cognitive 19) npm/pkg/dataplane/dataplane.go:708— DataPlane.createIPSetsAndReferences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.deleteIPSetsAndReferences (cognitive 19) npm/pkg/dataplane/dataplane.go:748— DataPlane.deleteIPSetsAndReferences has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DPShim.AddToLists (cognitive 19) npm/pkg/dataplane/dpshim/dpshim.go:224— DPShim.AddToLists has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileCreator.handleLineError (cognitive 19) npm/util/ioutil/restore.go:279— FileCreator.handleLineError has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
main.Check (cognitive 18) azure-iptables-monitor/iptables_monitor.go:294— main.Check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ipamPlugin.Add (cognitive 18) cni/ipam/ipam.go:141— ipamPlugin.Add has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HTTPRestService.MustEnsureNoStaleNCs (cognitive 18) cns/restserver/internalapi.go:577— HTTPRestService.MustEnsureNoStaleNCs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.validateNetworkContainerRequest (cognitive 18) cns/restserver/internalapi.go:672— HTTPRestService.validateNetworkContainerRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.updateEndpointStateUntransacted (cognitive 18) cns/restserver/ipam.go:391— HTTPRestService.updateEndpointStateUntransacted has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.MarkIPAsPendingRelease (cognitive 18) cns/restserver/ipam.go:680— HTTPRestService.MarkIPAsPendingRelease has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.findStaleContainerByApipaIP (cognitive 18) cns/restserver/ipam_windows.go:55— HTTPRestService.findStaleContainerByApipaIP has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (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.
LinuxBridgeClient.AddL2Rules (cognitive 18) network/bridge_networkclient_linux.go:88— LinuxBridgeClient.AddL2Rules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
networkManager.readDNSInfo (cognitive 18) network/network_linux.go:336— networkManager.readDNSInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
network.newEndpointImplHnsV1 (cognitive 18) network/endpoint_windows.go:177— network.newEndpointImplHnsV1 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs 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.
network.newEndpointImplHnsV2 (cognitive 18) network/endpoint_windows.go:455— network.newEndpointImplHnsV2 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, loops 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
policy.GetPolicyType (cognitive 18) network/policy/policy_windows.go:225— policy.GetPolicyType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (18 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetworkPolicyManager.MarshalJSON (cognitive 18) npm/npm.go:115— NetworkPolicyManager.MarshalJSON has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.refreshPodEndpoints (cognitive 18) npm/pkg/dataplane/dataplane_linux.go:33— DataPlane.refreshPodEndpoints has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse.parseModuleOptionAndValue (cognitive 18) npm/pkg/dataplane/parse/parser.go:333— parse.parseModuleOptionAndValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
PolicyManager.addPolicy (cognitive 18) npm/pkg/dataplane/policies/policymanager_windows.go:268— PolicyManager.addPolicy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aitelemetry.parseConnectionString (cognitive 17) aitelemetry/connection_string_parser.go:18— aitelemetry.parseConnectionString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NetPlugin.createEpInfo (cognitive 17) cni/network/network.go:745— NetPlugin.createEpInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 3, 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.
hnsclient.createHostNCApipaNetwork (cognitive 17) cns/hnsclient/hnsclient_windows.go:284— hnsclient.createHostNCApipaNetwork has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.unpublishNetworkContainer (cognitive 17) cns/restserver/api.go:1073— HTTPRestService.unpublishNetworkContainer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
HTTPRestService.cleanupContainerHNSResources (cognitive 17) cns/restserver/ipam_windows.go:99— HTTPRestService.cleanupContainerHNSResources has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service.AddListener (cognitive 17) cns/service.go:52— Service.AddListener has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (17 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.
networkManager.updateRoutes (cognitive 17) REDACTED:473— networkManager.updateRoutes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IptablesManager.UninitNpmChains (cognitive 17) npm/iptm/iptm.go:110— IptablesManager.UninitNpmChains has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceController.syncNameSpace (cognitive 17) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:221— NamespaceController.syncNameSpace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceController.syncUpdateNameSpace (cognitive 17) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:332— NamespaceController.syncUpdateNameSpace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
translation.TranslatePolicy (cognitive 17) npm/pkg/controlplane/translation/translatePolicy.go:723— translation.TranslatePolicy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataPlane.RemovePolicy (cognitive 17) npm/pkg/dataplane/dataplane.go:596— DataPlane.RemovePolicy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
debug.matchNAMEDPORTS (cognitive 17) npm/pkg/dataplane/debug/trafficanalyzer.go:404— debug.matchNAMEDPORTS has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IPSetManager.RemoveFromList (cognitive 17) npm/pkg/dataplane/ipsets/ipsetmanager.go:443— IPSetManager.RemoveFromList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ACLPolicy.comment (cognitive 17) npm/pkg/dataplane/policies/policy_linux.go:105— ACLPolicy.comment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyManager.cleanupChains (cognitive 17) npm/pkg/dataplane/policies/chain-management_linux.go:483— PolicyManager.cleanupChains has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1, jumps 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.
PolicyManager.positionAzureChainJumpRule (cognitive 17) npm/pkg/dataplane/policies/chain-management_linux.go:601— PolicyManager.positionAzureChainJumpRule has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolicyManager.batchPolicies (cognitive 17) npm/pkg/dataplane/policies/policymanager_windows.go:182— PolicyManager.batchPolicies has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
jsonFileStore.Read (cognitive 17) store/json.go:67— jsonFileStore.Read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (17 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IPConfigurationStatus.UnmarshalJSON (cognitive 16) cns/api.go:147— IPConfigurationStatus.UnmarshalJSON 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.
Config.Normalize (cognitive 16) cns/logger/v2/config.go:47— Config.Normalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
multitenantoperator.ipv6Configuration (cognitive 16) cns/multitenantcontroller/multitenantoperator/multitenantcrdreconciler.go:205— multitenantoperator.ipv6Configuration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
networkcontainers.setWeakHostOnInterface (cognitive 16) cns/networkcontainers/networkcontainers_linux.go:20— networkcontainers.setWeakHostOnInterface has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.requestIPConfigHandlerHelper (cognitive 16) cns/restserver/ipam.go:46— HTTPRestService.requestIPConfigHandlerHelper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 1 (2 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPRestService.saveNetworkContainerGoalStates (cognitive 16) cns/restserver/util.go:174— HTTPRestService.saveNetworkContainerGoalStates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinuxBridgeEndpointClient.AddEndpointRules (cognitive 16) REDACTED:76— LinuxBridgeEndpointClient.AddEndpointRules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
parse.Line (cognitive 16) npm/pkg/dataplane/parse/parser.go:153— parse.Line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ACLPolicy.convertToAclSettings (cognitive 16) npm/pkg/dataplane/policies/policy_windows.go:69— ACLPolicy.convertToAclSettings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D22 · Internal API Consistency· `HTTPService.GetPodIPConfigState` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`) · ×1
`HTTPService.GetPodIPConfigState` returns a map (`map[K]V`) where its 4 siblings return a slice (`[]T`) cns/api.go:54— 4 of 5 collection-returning members of `HTTPService` return a slice (`[]T`) (4 of 5). Siblings: HTTPService.GetPendingProgramIPConfigs (cns/api.go:50); HTTPService.GetAvailableIPConfigs (cns/api.go:51); HTTPService.GetAssignedIPConfigs (cns/api.go:52); HTTPService.GetPendingReleaseIPConfigs (cns/api.go:53). Return a slice (`[]T`). [rule A4]
D22 · Internal API Consistency· `Server.ListAndWatch` takes no context.Context; its 6 sibling operations take one · ×1
`Server.ListAndWatch` takes no context.Context; its 6 sibling operations take one REDACTED:118— 6 of 7 fallible operations of `Server` take a `ctx context.Context` (6 of 7). Siblings: Server.Run (REDACTED:44); Server.Ready (REDACTED:75); Server.Allocate (REDACTED:99); Server.GetDevicePluginOptions (REDACTED:166); Server.GetPreferredAllocation (REDACTED:170). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency· `metrics.GetHandler` signals absence with a bare `T` (the zero value when absent) where its 5 sibling single-key reads use `(T, error)` (an error when absent) · ×1
`metrics.GetHandler` signals absence with a bare `T` (the zero value when absent) where its 5 sibling single-key reads use `(T, error)` (an error when absent) npm/metrics/prometheus-metrics.go:360— 5 of 6 single-key reads of `package metrics` return `(T, error)` (an error when absent) (5 of 6). Siblings: metrics.TotalIPTablesRestoreLatencyCalls (npm/metrics/acl_rules_linux.go:25); metrics.TotalIPTablesRestoreFailures (npm/metrics/acl_rules_linux.go:39); metrics.TotalACLLatencyCalls (npm/metrics/acls_windows.go:21); metrics.TotalACLFailures (npm/metrics/acls_windows.go:27); metrics.GetNumEntriesForIPSet (npm/metrics/ipsets.go:122). Return `(T, error)` (an error when absent) like its siblings. [rule A5]
Change coupling: const.go ↔ restserver.go cns/restserver/const.go:1— `cns/restserver/const.go` and `cns/restserver/restserver.go` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `62fac6be` PUT/DELETE NC and subnet join related changes for RNC via NMA (#4597); `ddb59543` nmagent get nv version list api V2 refactor (#1744); `60e5a265` feat: CNS manages endpoints state for delegate IPAM use case (#1500) — run `git show` on any of them.
D4 · Code Duplication· Near-duplicate member family (8 members, 12 shared lines) · ×1
Near-duplicate member family (8 members, 12 shared lines) crd/clustersubnetstate/client.go:62— crd/clustersubnetstate/client.go:62-86 | crd/multitenancy/client.go:61-85 | crd/multitenancy/client.go:97-121 | crd/multitenancy/client.go:133-157 | crd/multitenancy/client.go:169-193 | crd/multitenancy/client.go:205-229 | crd/nodenetworkconfig/client.go:63-87 | crd/overlayextensionconfig/client.go:51-75 — These 8 members are variants of one another: a block of 12 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Near-duplicate member pair (236 shared lines) npm/pkg/controlplane/controllers/v1/translatePolicy.go:226— npm/pkg/controlplane/controllers/v1/translatePolicy.go:226-878 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:880-1535 — These two members are variants of one another: 236 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (50 shared lines) cni/network/plugin/main.go:53— cni/network/plugin/main.go:53-189 | cni/network/stateless/main.go:53-166 — These two members are variants of one another: 50 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) cns/client/client.go:153— cns/client/client.go:153-210 | cns/client/client.go:213-262 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (28 shared lines) cns/client/client.go:348— cns/client/client.go:348-392 | cns/client/client.go:435-485 — These two members are variants of one another: 28 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 (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:179— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:179-218 | npm/pkg/controlplane/controllers/v1/networkPolicyController.go:193-232 | npm/pkg/controlplane/controllers/v1/podController.go:208-247 | npm/pkg/controlplane/controllers/v2/namespaceController.go:185-225 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:167-207 | npm/pkg/controlplane/controllers/v2/podController.go:211-251 — 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) cns/client/client.go:681— cns/client/client.go:681-726 | cns/client/client.go:729-779 | cns/client/client.go:783-827 | cns/client/client.go:833-875 | cns/client/client.go:880-921 — 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· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) network/hnswrapper/hnsv1wrapperwithtimeout.go:40— network/hnswrapper/hnsv1wrapperwithtimeout.go:40-60 | network/hnswrapper/hnsv1wrapperwithtimeout.go:62-82 | network/hnswrapper/hnsv1wrapperwithtimeout.go:128-148 | network/hnswrapper/hnsv1wrapperwithtimeout.go:150-170 — 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 (136 corresponding lines) · ×1
Edited copy of a member (136 corresponding lines) cns/restserver/api.go:936— cns/restserver/api.go:936-1071 | cns/restserver/api.go:1073-1228 — These two members are one piece of code written twice and then edited apart: 136 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) network/snat/snat_linux.go:187— network/snat/snat_linux.go:187-253 | network/snat/snat_linux.go:283-351 — 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 copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:332— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:332-394 | npm/pkg/controlplane/controllers/v2/namespaceController.go:349-429 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) cns/kubecontroller/nodenetworkconfig/conversion_linux.go:18— cns/kubecontroller/nodenetworkconfig/conversion_linux.go:18-75 | cns/kubecontroller/nodenetworkconfig/conversion_windows.go:20-84 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (66 corresponding lines) · ×1
Edited copy of a member (66 corresponding lines) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:221— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:221-286 | npm/pkg/controlplane/controllers/v2/namespaceController.go:228-315 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (91 corresponding lines) · ×1
Edited copy of a member (91 corresponding lines) npm/pkg/controlplane/controllers/v1/parseSelector.go:141— npm/pkg/controlplane/controllers/v1/parseSelector.go:141-231 | npm/pkg/controlplane/translation/parseSelector.go:21-118 — These two members are one piece of code written twice and then edited apart: 91 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 71+ corresponding lines) · ×1
Edited copies of one member (3 members, 71+ corresponding lines) npm/pkg/controlplane/controllers/v1/networkPolicyController.go:235— npm/pkg/controlplane/controllers/v1/networkPolicyController.go:235-305 | npm/pkg/controlplane/controllers/v1/podController.go:250-325 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:210-280 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 71 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) bpf-prog/ipv6-hp-bpf/pkg/egress/egress.go:11— bpf-prog/ipv6-hp-bpf/pkg/egress/egress.go:11-57 | bpf-prog/ipv6-hp-bpf/pkg/ingress/ingress.go:11-57 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) cns/service.go:207— cns/service.go:207-260 | cns/service.go:262-315 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) cns/restserver/api.go:181— cns/restserver/api.go:181-234 | cns/restserver/api.go:288-337 — 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 copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) cns/restserver/ipam.go:345— cns/restserver/ipam.go:345-383 | cns/restserver/ipam.go:628-656 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) cns/restserver/ipam.go:460— cns/restserver/ipam.go:460-496 | cns/restserver/ipam.go:498-533 — 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 copies of one member (4 members, 38+ corresponding lines) · ×1
Edited copies of one member (4 members, 38+ corresponding lines) cns/client/client.go:265— cns/client/client.go:265-303 | cns/client/client.go:306-345 | cns/client/client.go:537-578 | cns/client/client.go:1149-1186 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 38 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, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) cns/client/client.go:581— cns/client/client.go:581-607 | cns/client/client.go:645-677 | cns/client/client.go:1036-1068 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) aitelemetry/telemetrywrapper.go:180— aitelemetry/telemetrywrapper.go:180-216 | aitelemetry/telemetrywrapper.go:219-256 — 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) · ×1
Edited copy of a member (25 corresponding lines) platform/os_windows.go:194— platform/os_windows.go:194-218 | platform/os_windows.go:222-247 — 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 copies of one member (5 members, 24+ corresponding lines) · ×1
Edited copies of one member (5 members, 24+ corresponding lines) nmagent/client.go:141— nmagent/client.go:141-164 | nmagent/client.go:188-211 | nmagent/client.go:234-257 | nmagent/client.go:260-284 | nmagent/client.go:287-315 — 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 (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:130— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:130-158 | npm/pkg/controlplane/controllers/v2/namespaceController.go:133-161 | npm/pkg/controlplane/controllers/v2/podController.go:154-189 — 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 (4 members, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) cns/cniconflist/generator_linux.go:27— cns/cniconflist/generator_linux.go:27-54 | cns/cniconflist/generator_linux.go:57-83 | cns/cniconflist/generator_linux.go:86-112 | cns/cniconflist/generator_linux.go:142-168 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 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, 21+ corresponding lines) · ×1
Edited copies of one member (3 members, 21+ corresponding lines) network/hnswrapper/hnsv2wrapperwithtimeout.go:60— network/hnswrapper/hnsv2wrapperwithtimeout.go:60-81 | network/hnswrapper/hnsv2wrapperwithtimeout.go:300-321 | network/hnswrapper/hnsv2wrapperwithtimeout.go:386-406 — 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, 21+ corresponding lines) · ×1
Edited copies of one member (5 members, 21+ corresponding lines) network/hnswrapper/hnsv1wrapperwithtimeout.go:84— network/hnswrapper/hnsv1wrapperwithtimeout.go:84-104 | network/hnswrapper/hnsv1wrapperwithtimeout.go:106-126 | network/hnswrapper/hnsv2wrapperwithtimeout.go:101-121 | network/hnswrapper/hnsv2wrapperwithtimeout.go:254-275 | network/hnswrapper/hnsv2wrapperwithtimeout.go:277-298 — 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, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) platform/os_linux.go:93— platform/os_linux.go:93-117 | platform/os_linux.go:120-144 | platform/os_windows.go:122-140 | platform/os_windows.go:143-165 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×1
Edited copies of one member (4 members, 17+ corresponding lines) cns/wireserver/proxy.go:26— cns/wireserver/proxy.go:26-48 | cns/wireserver/proxy.go:50-67 | cns/wireserver/proxy.go:69-85 | cns/wireserver/proxy.go:87-110 — These 4 members are one piece of code written 4 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 4 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) netlink/link_linux.go:218— netlink/link_linux.go:218-242 | netlink/link_linux.go:245-273 | netlink/link_linux.go:355-378 | netlink/link_linux.go:382-410 — 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 (5 members, 17+ corresponding lines) · ×1
Edited copies of one member (5 members, 17+ corresponding lines) cns/logger/v2/config.go:27— cns/logger/v2/config.go:27-43 | cns/logger/v2/cores/ai.go:27-43 | cns/logger/v2/cores/etw_windows.go:24-40 | cns/logger/v2/cores/file.go:25-41 | cns/logger/v2/cores/stdout.go:23-39 — 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 (9 members, 16+ corresponding lines) · ×1
Edited copies of one member (9 members, 16+ corresponding lines) network/hnswrapper/hnsv1wrapperwithtimeout.go:172— network/hnswrapper/hnsv1wrapperwithtimeout.go:172-187 | network/hnswrapper/hnsv2wrapperwithtimeout.go:83-99 | network/hnswrapper/hnsv2wrapperwithtimeout.go:123-139 | network/hnswrapper/hnsv2wrapperwithtimeout.go:141-157 | network/hnswrapper/hnsv2wrapperwithtimeout.go:159-175 | network/hnswrapper/hnsv2wrapperwithtimeout.go:177-193 | network/hnswrapper/hnsv2wrapperwithtimeout.go:218-234 | network/hnswrapper/hnsv2wrapperwithtimeout.go:236-252 | network/hnswrapper/hnsv2wrapperwithtimeout.go:369-384 — These 9 members are one piece of code written 9 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 9 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) cns/restserver/api.go:603— cns/restserver/api.go:603-624 | cns/restserver/api.go:669-683 | cns/restserver/api.go:835-849 | cns/restserver/api.go:851-865 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) cns/restserver/api.go:392— cns/restserver/api.go:392-401 | cns/restserver/api.go:404-413 | cns/restserver/api.go:416-425 — 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 (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:60— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:60-76 | npm/pkg/controlplane/controllers/v2/namespaceController.go:64-80 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:47-64 — 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 (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) cns/logger/cnslogger.go:113— cns/logger/cnslogger.go:113-124 | cns/logger/cnslogger.go:126-137 | cns/logger/cnslogger.go:139-150 | cns/logger/cnslogger.go:152-163 — 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 copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) npm/pkg/controlplane/gobutils.go:11— npm/pkg/controlplane/gobutils.go:11-21 | npm/pkg/controlplane/gobutils.go:35-45 | npm/pkg/controlplane/gobutils.go:59-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) ovsctl/ovsctl.go:64— ovsctl/ovsctl.go:64-75 | ovsctl/ovsctl.go:77-88 | ovsctl/ovsctl.go:112-121 | ovsctl/ovsctl.go:123-133 | ovsctl/ovsctl.go:295-305 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 7+ corresponding lines) · ×1
Edited copies of one member (3 members, 7+ corresponding lines) npm/pkg/dataplane/policies/policy.go:284— npm/pkg/dataplane/policies/policy.go:284-290 | npm/pkg/dataplane/policies/policy_linux.go:78-84 | tools/release/internal/github/github.go:434-441 — 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.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) crd/clustersubnetstate/client.go:44— crd/clustersubnetstate/client.go:44-50 | crd/multitenancy/client.go:43-49 | crd/nodenetworkconfig/client.go:45-51 | crd/overlayextensionconfig/client.go:42-48 — 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.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) crd/clustersubnetstate/client.go:101— crd/clustersubnetstate/client.go:101-105 | crd/nodenetworkconfig/client.go:102-106 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (41–42 lines × 2) cns/middlewares/k8sSwiftV2_linux.go:140— cns/middlewares/k8sSwiftV2_linux.go:140-180 | cns/middlewares/k8sSwiftV2_windows.go:194-235 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cns/middlewares/k8sSwiftV2_linux.go:140` 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 (38 lines × 2) cni/ipam/plugin/main.go:22— cni/ipam/plugin/main.go:22-59 | cni/ipam/pluginv6/main.go:22-59 — `cni/ipam/plugin/main.go` and `cni/ipam/pluginv6/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 1 separate duplicated blocks between them, totalling at least 38 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (62 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1202— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1202-1263 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1311-1372 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1202` 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 (30 lines × 2) cni/network/plugin/main.go:84— cni/network/plugin/main.go:84-113 | cni/network/stateless/main.go:91-120 — `cni/network/plugin/main.go` and `cni/network/stateless/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 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. Read the line range as the matched WINDOW rather than a finished unit: at `cni/network/plugin/main.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.
Duplicated block (24–28 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:551— npm/pkg/controlplane/controllers/v1/translatePolicy.go:551-574 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:661-684 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:778-805 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:551` 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 (27–28 lines × 2) cns/client/client.go:752— cns/client/client.go:752-779 | cns/client/client.go:801-827 — both copies are in the same file, so extract the 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 `cns/client/client.go:752` 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 (24 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:504— npm/pkg/controlplane/controllers/v1/translatePolicy.go:504-527 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1160-1183 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:504` it does not close everything it opens, so those exact lines 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:585— npm/pkg/controlplane/controllers/v1/translatePolicy.go:585-607 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:695-717 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:585` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:444— npm/pkg/controlplane/controllers/v1/translatePolicy.go:444-464 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:564-584 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:674-694 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) server/tls/tlscertificate_retriever_linux.go:64— server/tls/tlscertificate_retriever_linux.go:64-84 | server/tls/tlscertificate_retriever_windows.go:67-87 — before extracting anything, compare `server/tls/tlscertificate_retriever_linux.go` and `server/tls/tlscertificate_retriever_windows.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18–20 lines × 2) cns/restserver/ipam.go:276— cns/restserver/ipam.go:276-295 | cns/restserver/ipam.go:588-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/restserver/ipam.go:276` 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) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1096— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1096-1114 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1222-1240 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1331-1349 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1096` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:417— npm/pkg/controlplane/controllers/v1/translatePolicy.go:417-434 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:541-558 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:651-668 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:417` 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 (32 lines × 2) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:246— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:246-277 | npm/pkg/controlplane/controllers/v2/namespaceController.go:275-306 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `npm/pkg/controlplane/controllers/v1/nameSpaceController.go:246` 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 (36 lines × 2) npm/pkg/controlplane/controllers/v1/podController.go:268— npm/pkg/controlplane/controllers/v1/podController.go:268-303 | npm/pkg/controlplane/controllers/v2/podController.go:295-330 — `npm/pkg/controlplane/controllers/v1/podController.go` and `npm/pkg/controlplane/controllers/v2/podController.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 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. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/podController.go: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. 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–17 lines × 3) nmagent/client.go:81— nmagent/client.go:81-96 | nmagent/client.go:169-184 | nmagent/client.go:216-232 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 3) npm/pkg/controlplane/controllers/v1/translatePolicy.go:1067— npm/pkg/controlplane/controllers/v1/translatePolicy.go:1067-1082 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1197-1212 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1306-1321 — all 3 copies are in the same file, so extract the block into one function there and call 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:1067` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) cns/client/client.go:171— cns/client/client.go:171-186 | cns/client/client.go:456-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cns/client/client.go:171` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–16 lines × 2) cns/middlewares/k8sSwiftV2_linux.go:120— cns/middlewares/k8sSwiftV2_linux.go:120-133 | cns/middlewares/k8sSwiftV2_windows.go:135-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cns/middlewares/k8sSwiftV2_linux.go:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 6) npm/pkg/controlplane/controllers/v1/nameSpaceController.go:180— npm/pkg/controlplane/controllers/v1/nameSpaceController.go:180-194 | npm/pkg/controlplane/controllers/v1/networkPolicyController.go:194-208 | npm/pkg/controlplane/controllers/v1/podController.go:209-223 | npm/pkg/controlplane/controllers/v2/namespaceController.go:186-200 | npm/pkg/controlplane/controllers/v2/networkPolicyController.go:168-182 | npm/pkg/controlplane/controllers/v2/podController.go:212-226 — `npm/pkg/controlplane/controllers/v1/nameSpaceController.go` and `npm/pkg/controlplane/controllers/v2/namespaceController.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 106 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `npm/pkg/controlplane/controllers/v1/nameSpaceController.go:180` it does not close everything it opens, so those 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 (15 lines × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:442— npm/pkg/controlplane/controllers/v1/translatePolicy.go:442-456 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:562-576 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:672-686 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:793-807 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) cns/service/main.go:1206— cns/service/main.go:1206-1219 | cns/service/main.go:1434-1448 | cns/service/main.go:1767-1780 — all 3 copies are in the same file, so extract the block into one function there and call 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 (13 lines × 6) npm/pkg/controlplane/controllers/v1/translatePolicy.go:317— npm/pkg/controlplane/controllers/v1/translatePolicy.go:317-329 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:396-408 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:967-979 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1046-1058 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1293-1305 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1410-1422 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `npm/pkg/controlplane/controllers/v1/translatePolicy.go:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–12 lines × 2) npm/pkg/controlplane/translation/translatePolicy.go:349— npm/pkg/controlplane/translation/translatePolicy.go:349-360 | npm/pkg/controlplane/translation/translatePolicy.go:788-797 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/translation/translatePolicy.go:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `npm/pkg/controlplane/translation/translatePolicy.go:361` calls `AddSetInfo` and `npm/pkg/controlplane/translation/translatePolicy.go:798` 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–11 lines × 5) cns/client/client.go:167— cns/client/client.go:167-176 | cns/client/client.go:227-236 | cns/client/client.go:365-375 | cns/client/client.go:452-461 | cns/client/client.go:552-561 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 5) cns/client/client.go:697— cns/client/client.go:697-707 | cns/client/client.go:751-761 | cns/client/client.go:800-810 | cns/client/client.go:848-858 | cns/client/client.go:894-904 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:426— npm/pkg/controlplane/controllers/v1/translatePolicy.go:426-436 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:550-560 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:660-670 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:777-787 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:426` 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–11 lines × 3) cns/client/client.go:648— cns/client/client.go:648-658 | cns/client/client.go:1039-1049 | cns/client/client.go:1073-1082 — all 3 copies are in the same file, so extract the block into one function there and call 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 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–11 lines × 2) cns/middlewares/mock/mockClient.go:30— cns/middlewares/mock/mockClient.go:30-40 | cns/middlewares/mock/mockClient.go:70-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) npm/pkg/controlplane/controllers/v1/translatePolicy.go:989— npm/pkg/controlplane/controllers/v1/translatePolicy.go:989-997 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1077-1086 — both copies are in the same file, so extract the 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:989` 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 (9 lines × 3) cns/client/client.go:370— cns/client/client.go:370-379 | cns/client/client.go:557-565 | cns/client/client.go:587-595 — all 3 copies are in the same file, so extract the block into one function there and call 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. 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 before the matched lines, `cns/client/client.go:369` calls `Set` and `cns/client/client.go:586` 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 × 3) network/transparent_endpointclient_linux.go:145— network/transparent_endpointclient_linux.go:145-154 | network/transparent_endpointclient_linux.go:177-186 | network/transparent_vlan_endpointclient_linux.go:717-726 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 8) crd/clustersubnetstate/client.go:67— crd/clustersubnetstate/client.go:67-73 | crd/multitenancy/client.go:66-72 | crd/multitenancy/client.go:102-108 | crd/multitenancy/client.go:138-144 | crd/multitenancy/client.go:174-180 | crd/multitenancy/client.go:210-216 | crd/nodenetworkconfig/client.go:68-74 | crd/overlayextensionconfig/client.go:56-62 — there are 8 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 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 `crd/clustersubnetstate/client.go:67` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) npm/pkg/controlplane/controllers/v1/translatePolicy.go:624— npm/pkg/controlplane/controllers/v1/translatePolicy.go:624-630 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:736-742 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1279-1285 | npm/pkg/controlplane/controllers/v1/translatePolicy.go:1392-1398 — 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 `npm/pkg/controlplane/controllers/v1/translatePolicy.go:624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 8) crd/clustersubnetstate/client.go:77— crd/clustersubnetstate/client.go:77-81 | crd/multitenancy/client.go:76-80 | crd/multitenancy/client.go:112-116 | crd/multitenancy/client.go:148-152 | crd/multitenancy/client.go:184-188 | crd/multitenancy/client.go:220-224 | crd/nodenetworkconfig/client.go:78-82 | crd/overlayextensionconfig/client.go:66-70 — there are 8 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 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 `crd/clustersubnetstate/client.go:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) tools/acncli/cmd/cni/logs.go:27— tools/acncli/cmd/cni/logs.go:27-53 | tools/acncli/cmd/logs.go:27-53 — before extracting anything, compare `tools/acncli/cmd/cni/logs.go` and `tools/acncli/cmd/logs.go` as WHOLE FILES: 91% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (51 lines × 2) tools/acncli/cmd/cni/install.go:27— tools/acncli/cmd/cni/install.go:27-77 | tools/acncli/cmd/install.go:27-77 — before extracting anything, compare `tools/acncli/cmd/cni/install.go` and `tools/acncli/cmd/install.go` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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.
X3 · Exception handling· Lost error (reports an error that is nil on this path) · ×1
Lost error (reports an error that is nil on this path) telemetry/telemetry.go:160— `if err == nil` reports `err` on the one path where it is nil, and the path where the call failed goes on without ever reading it: the comparison is inverted. The real failure is lost and a nil error (or a panic on `err.Error()`) is reported in its place. Test `err != nil` here.
X3 · Exception handling· Lost error (the deferred cleanup tests an error the failure never reaches) · ×1
Lost error (the deferred cleanup tests an error the failure never reaches) network/endpoint_windows.go:241— `if err := nw.addIPv6NeighborEntryForGateway(epInfo, plc); err != nil {` declares a NEW `err` in an inner scope, and the failure it carries leaves through a `return` — but the deferred cleanup tests the outer `err`, which stays nil, so the cleanup (a rollback, a removal) never runs on that failure. Assign the outer variable (`=`), or name the function's error result `err` so `return` sets what the deferred function reads.
Orphaned file network/hnswrapper/hnsv2wrapperfake.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 npm/pkg/dataplane/dpshim/dpshim.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 npm/pkg/controlplane/controllers/v1/nameSpaceController.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 nmagent/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 npm/metrics/prometheus-metrics.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 npm/pkg/dataplane/ipsets/ipsetmanager_windows.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 npm/iptm/iptm.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 ipam/pool.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 aitelemetry/telemetrywrapper.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 npm/pkg/controlplane/goalstateprocessor/goalstateprocessor.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 npm/util/ioutil/restore.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 npm/pkg/dataplane/ipsets/ipset.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 network/hnswrapper/hnsv2wrapperwithtimeout.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 netlink/link_linux.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 network/transparent_endpointclient_linux.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 ovsctl/ovsctl.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 telemetry/telemetrybuffer.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 npm/util/const.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 network/network.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 nmagent/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 npm/pkg/controlplane/controllers/v1/parseSelector.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 network/ovs_endpointclient_linux.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 network/networkutils/networkutils_linux.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.
No seccomp profile REDACTED:10— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:57— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:3— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:3— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:3— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:3— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:34— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:64— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:41— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:79— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:53— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:112— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:95— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:53— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
Duplicated predicate npm/pkg/controlplane/controllers/v1/parseSelector.go:207— `(req.Operator == metav1.LabelSelectorOpExists) || (req.Operator == metav1.LabelSelectorOpDoesNotExist)` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/parseSelector.go, npm/pkg/controlplane/translation/parseSelector.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 npm/pkg/controlplane/controllers/v1/parseSelector.go:199— `(req.Operator == metav1.LabelSelectorOpIn) || (req.Operator == metav1.LabelSelectorOpNotIn)` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/parseSelector.go, npm/pkg/controlplane/translation/parseSelector.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 cns/kubecontroller/nodenetworkconfig/conversion_linux.go:43— `cidrPrefix.Addr().Is6() && ipv6PrefixClamp > 0 && cidrPrefix.Bits() < ipv6PrefixClamp` appears character-identically in 2 files — cns/kubecontroller/nodenetworkconfig/conversion_linux.go, cns/kubecontroller/nodenetworkconfig/conversion_windows.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 cni/network/network_linux.go:39— `cnsNwConfig != nil && cnsNwConfig.MultiTenancyInfo.ID != 0` appears character-identically in 2 files — cni/network/network_linux.go, cni/network/network_windows.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 network/network_linux.go:406— `err != nil && !strings.Contains(strings.ToLower(err.Error()), "file exists")` appears character-identically in 2 files — network/network_linux.go, network/snat/snat_linux.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 cns/kubecontroller/nodenetworkconfig/conversion_linux.go:24— `isSwiftV2 && nc.Type == v1alpha.VNETBlock` appears character-identically in 2 files — cns/kubecontroller/nodenetworkconfig/conversion_linux.go, cns/kubecontroller/nodenetworkconfig/conversion_windows.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 npm/pkg/dataplane/dpshim/dpshim.go:225— `len(listMetadatas) == 0 || len(setMetadatas) == 0` appears character-identically in 2 files — npm/pkg/dataplane/dpshim/dpshim.go, npm/pkg/dataplane/ipsets/ipsetmanager.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 npm/pkg/controlplane/controllers/v1/parseSelector.go:274— `len(selector.MatchLabels) == 0 && len(selector.MatchExpressions) == 0` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/parseSelector.go, npm/pkg/controlplane/translation/parseSelector.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 cns/ipampool/metrics/observer.go:130— `nc.Type == "" || nc.Type == v1alpha.VNET` appears character-identically in 2 files — cns/ipampool/metrics/observer.go, cns/ipampool/monitor.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 npm/pkg/controlplane/controllers/v1/networkPolicyController.go:276— `netPolObj.ObjectMeta.DeletionTimestamp != nil || netPolObj.ObjectMeta.DeletionGracePeriodSeconds != nil` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/networkPolicyController.go, npm/pkg/controlplane/controllers/v2/networkPolicyController.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 npm/pkg/controlplane/controllers/v1/nameSpaceController.go:342— `newNsObj.ObjectMeta.DeletionTimestamp == nil && newNsObj.ObjectMeta.DeletionGracePeriodSeconds == nil` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/nameSpaceController.go, npm/pkg/controlplane/controllers/v2/namespaceController.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 network/manager.go:902— `nm.IsStatelessCNIMode() && nicType != cns.InfraNIC` appears character-identically in 2 files — network/manager.go, network/manager_mock.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 npm/pkg/controlplane/controllers/v1/nameSpaceController.go:263— `nsObj.DeletionTimestamp != nil || nsObj.DeletionGracePeriodSeconds != nil` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/nameSpaceController.go, npm/pkg/controlplane/controllers/v2/namespaceController.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 npm/pkg/controlplane/controllers/v1/podController.go:584— `podObj.Status.Phase == corev1.PodSucceeded || podObj.Status.Phase == corev1.PodFailed` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/podController.go, npm/pkg/controlplane/controllers/v2/podController.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 npm/pkg/controlplane/controllers/v1/translatePolicy.go:39— `portRule.Port == nil || portRule.Port.IntValue() != 0` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/translatePolicy.go, npm/pkg/controlplane/translation/translatePolicy.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 npm/pkg/controlplane/controllers/v1/translatePolicy.go:41— `portRule.Port.IntValue() == 0 && portRule.Port.String() != ""` appears character-identically in 2 files — npm/pkg/controlplane/controllers/v1/translatePolicy.go, npm/pkg/controlplane/translation/translatePolicy.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 cns/ipampool/metrics/observer.go:76— `subscription == "" || resourceGroup == "" || vnetID == "" || subnetID == ""` appears character-identically in 2 files — cns/ipampool/metrics/observer.go, cns/ipampool/monitor.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 npm/cmd/main.go:59— `viper.IsSet(flag.Name) && viper.GetString(flag.Name) != ""` appears character-identically in 2 files — npm/cmd/main.go, tools/acncli/main.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: NetlinkInterface (17 methods) netlink/netlinkinterface.go:10— `NetlinkInterface` declares 17 methods: `AddLink`, `DeleteLink`, `SetLinkName`, `SetLinkState`, `SetLinkMTU`, `SetLinkMaster`, `SetLinkNetNs`, `SetLinkNetNsByIndex`, `SetLinkAddress`, `SetLinkPromisc`, `SetLinkHairpin`, `SetOrRemoveLinkAddress`, `AddIPAddress`, `DeleteIPAddress`, `GetIPRoute`, `AddIPRoute`, `DeleteIPRoute`. 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: NetworkManager (25 methods) network/manager.go:102— `NetworkManager` declares 25 methods: `Initialize`, `Uninitialize`, `AddExternalInterface`, `CreateNetwork`, `DeleteNetwork`, `GetNetworkInfo`, `FindNetworkIDFromNetNs`, `GetNumEndpointsByContainerID`, `CreateEndpoint`, `EndpointCreate`, `DeleteEndpoint`, `GetEndpointInfo`, `GetAllEndpoints`, `GetEndpointInfoBasedOnPODDetails`, `AttachEndpoint`, `DetachEndpoint`, `UpdateEndpoint`, `GetNumberOfEndpoints`, `GetEndpointID`, `IsStatelessCNIMode`, `SaveState`, `DeleteState`, `GetEndpointInfosFromContainerID`, `GetEndpointState`, `GetEndpointIDByNicType`. 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: GenericDataplane (16 methods) npm/pkg/dataplane/types.go:13— `GenericDataplane` declares 16 methods: `BootupDataplane`, `FinishBootupPhase`, `RunPeriodicTasks`, `GetAllIPSets`, `GetIPSet`, `CreateIPSets`, `DeleteIPSet`, `AddToSets`, `RemoveFromSets`, `AddToLists`, `RemoveFromList`, `ApplyDataPlane`, `GetAllPolicies`, `AddPolicy`, `RemovePolicy`, `UpdatePolicy`. 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: HnsV2WrapperInterface (18 methods) network/hnswrapper/hnsv2wrapperinterface.go:11— `HnsV2WrapperInterface` declares 18 methods: `CreateEndpoint`, `DeleteEndpoint`, `CreateNetwork`, `DeleteNetwork`, `ModifyNetworkSettings`, `AddNetworkPolicy`, `RemoveNetworkPolicy`, `GetNamespaceByID`, `AddNamespaceEndpoint`, `RemoveNamespaceEndpoint`, `GetNetworkByName`, `GetNetworkByID`, `GetEndpointByID`, `ListEndpointsOfNetwork`, `ListEndpointsQuery`, `ApplyEndpointPolicy`, `GetEndpointByName`, `HNSV2Supported`. 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.
Interpolated log message defeats structured logging cns/logger/cnslogger.go:118— `Info` at line 118 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 cns/logger/cnslogger.go:131— `Debug` at line 131 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 cns/logger/cnslogger.go:144— `Warn` at line 144 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 cns/logger/cnslogger.go:157— `Error` at line 157 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.Error("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Error("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Error("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 4 significant file(s) lose their only recent owner: tools/failure-agent/internal/classify/llm.go, tools/failure-agent/internal/model/model.go, tools/failure-agent/internal/collect/collect.go, tools/failure-agent/internal/report/report.go. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: tools/release/cmd/release-cli/main.go, tools/release/internal/version/version.go, tools/failure-agent/internal/redact/redact.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: store/json.go, cns/restserver/endpoint_delete_intent.go, cns/restserver/v2/server.go. Pair on, review, or document these before any departure.
D21 · Naming Consistency· `PodIpInfo` spells `Ip` where 528 names in the project spell it `IP` · ×2
`PodIpInfo` spells `Ip` where 528 names in the project spell it `IP` cns/NetworkContainerContract.go:525— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `PodIPInfo`. [rule N6]
`PodIpInfo` spells `Ip` where 528 names in the project spell it `IP` cns/NetworkContainerContract.go:581— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `PodIPInfo`. [rule N6]
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 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 (19 single-owned of 266 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; 266 of the 529 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (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: REDACTED, nns/grpcclient.go, cns/restserver/nmagentmonitor.go, cns/wireserver/proxy.go, npm/pkg/controlplane/controllers/v2/networkPolicyController.go, REDACTED, cns/fsnotify/fsnotify.go, cni/network/plugin/main.go (+1 more).
No ADRs found pkgerrlint/cmd/pkgerrlint/main.go:1— 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 `pkgerrlint/cmd/pkgerrlint/main.go` makes this repository a deployable product (line 1).
D21 · Naming Consistency· `HostIp` spells `Ip` where 528 names in the project spell it `IP` · ×1
`HostIp` spells `Ip` where 528 names in the project spell it `IP` cni/netconfig.go:28— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `HostIP`. [rule N6]
D21 · Naming Consistency· `virtualGW` spells `GW` where 12 names in the project spell it `Gw` · ×1
`virtualGW` spells `GW` where 12 names in the project spell it `Gw` cns/middlewares/k8sSwiftV2.go:24— 12 of 13 names in project github.com/Azure/azure-container-networking spell the token `Gw` (12 of 13; unit: names in project github.com/Azure/azure-container-networking containing `Gw`). Peers: hnsclient.ExtHnsNetworkGwAddress (cns/hnsclient/hnsclient_windows.go:29); hnsclient.defaultHnsGwIPAddress (cns/hnsclient/hnsclient_windows.go:60); hnsclient.updateGwForLocalIPConfiguration (cns/hnsclient/hnsclient_windows.go:626); network.defaultV6HostGw (REDACTED:17); network.defaultHostGwMac (REDACTED:18). Rename to `virtualGw`. [rule N6]
D21 · Naming Consistency· `getSwiftV2IpConfigHelper` spells `Ip` where 528 names in the project spell it `IP` · ×1
`getSwiftV2IpConfigHelper` spells `Ip` where 528 names in the project spell it `IP` cns/middlewares/k8sSwiftV2.go:101— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `getSwiftV2IPConfigHelper`. [rule N6]
D21 · Naming Consistency· `programSNATRules` spells `SNAT` where 82 names in the project spell it `Snat` · ×1
`programSNATRules` spells `SNAT` where 82 names in the project spell it `Snat` cns/restserver/internalapi_linux.go:38— 82 of 84 names in project github.com/Azure/azure-container-networking spell the token `Snat` (82 of 84; unit: names in project github.com/Azure/azure-container-networking containing `Snat`). Peers: NetworkConfig.EnableSnatOnHost (cni/netconfig.go:71); MultitenancyClient.DetermineSnatFeatureOnHost (cni/network/multitenancy.go:39); Multitenancy.DetermineSnatFeatureOnHost (cni/network/multitenancy.go:77); network.errSnatIP (cni/network/multitenancy.go:404); MockMultitenancy.DetermineSnatFeatureOnHost (cni/network/multitenancy_mock.go:46). Rename to `programSnatRules`. [rule N6]
D21 · Naming Consistency· `scenarioSWIFT` spells `SWIFT` where 17 names in the project spell it `Swift` · ×1
`scenarioSWIFT` spells `SWIFT` where 17 names in the project spell it `Swift` cns/service/main.go:128— 17 of 18 names in project github.com/Azure/azure-container-networking spell the token `Swift` (17 of 18; unit: names in project github.com/Azure/azure-container-networking containing `Swift`). Peers: util.V4Swift (cni/util/const.go:9); CNSConfig.EnableSwiftV1DualStack (cns/configuration/configuration.go:45); CNSConfig.EnableSwiftV2 (cns/configuration/configuration.go:46); CNSConfig.EnableSwiftV2PrefixAllocation (cns/configuration/configuration.go:47); configuration.LabelNodeSwiftV2 (cns/configuration/env.go:16). Rename to `scenarioSwift`. [rule N6]
D21 · Naming Consistency· `SetArpDropRuleForIpCidr` spells `Ip` where 528 names in the project spell it `IP` · ×1
`SetArpDropRuleForIpCidr` spells `Ip` where 528 names in the project spell it `IP` ebtables/ebtables.go:197— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `SetArpDropRuleForIPCidr`. [rule N6]
D21 · Naming Consistency· `setIpRoute` spells `Ip` where 528 names in the project spell it `IP` · ×1
`setIpRoute` spells `Ip` where 528 names in the project spell it `IP` netlink/ip_linux.go:215— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `setIPRoute`. [rule N6]
D21 · Naming Consistency· `newAttributeIpAddress` spells `Ip` where 528 names in the project spell it `IP` · ×1
`newAttributeIpAddress` spells `Ip` where 528 names in the project spell it `IP` REDACTED:224— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `newAttributeIPAddress`. [rule N6]
D21 · Naming Consistency· `getEndpointByPOD` spells `POD` where 154 names in the project spell it `Pod` · ×1
`getEndpointByPOD` spells `POD` where 154 names in the project spell it `Pod` network/endpoint.go:268— 154 of 158 names in project github.com/Azure/azure-container-networking spell the token `Pod` (154 of 158; unit: names in project github.com/Azure/azure-container-networking containing `Pod`). Peers: NetworkConfig.EnableExactMatchForPodName (cni/netconfig.go:72); github.com/Azure/azure-container-networking/cni.K8SPodEnvArgs (cni/netconfig.go:97); NetPlugin.getPodInfo (cni/network/network.go:315); createEpInfoOpt.k8sPodName (cni/network/network.go:730); cns.PathDebugPodContext (cns/NetworkContainerContract.go:43). Rename to `getEndpointByPod`. [rule N6]
D21 · Naming Consistency· `GetEndpointInfoBasedOnPODDetails` spells `POD` where 154 names in the project spell it `Pod` · ×1
`GetEndpointInfoBasedOnPODDetails` spells `POD` where 154 names in the project spell it `Pod` network/manager.go:120— 154 of 158 names in project github.com/Azure/azure-container-networking spell the token `Pod` (154 of 158; unit: names in project github.com/Azure/azure-container-networking containing `Pod`). Peers: NetworkConfig.EnableExactMatchForPodName (cni/netconfig.go:72); github.com/Azure/azure-container-networking/cni.K8SPodEnvArgs (cni/netconfig.go:97); NetPlugin.getPodInfo (cni/network/network.go:315); createEpInfoOpt.k8sPodName (cni/network/network.go:730); cns.PathDebugPodContext (cns/NetworkContainerContract.go:43). Rename to `GetEndpointInfoBasedOnPodDetails`. [rule N6]
D21 · Naming Consistency· `childPSSets` spells `PS` where 63 names in the project spell it `Ps` · ×1
`childPSSets` spells `PS` where 63 names in the project spell it `Ps` npm/pkg/controlplane/translation/translatePolicy.go:46— 63 of 64 names in project github.com/Azure/azure-container-networking spell the token `Ps` (63 of 64; unit: names in project github.com/Azure/azure-container-networking containing `Ps`). Peers: NetworkConfig.IPsToRouteViaHost (cni/netconfig.go:69); cnsclient.RequestIPs (cni/network/cnsclient.go:12); cnsclient.ReleaseIPs (cni/network/cnsclient.go:13); HTTPService.MarkNIPsPendingRelease (cns/api.go:57); Client.RequestIPs (cns/client/client.go:435). Rename to `childPsSets`. [rule N6]
D21 · Naming Consistency· `matchNAMESPACE` spells `NAMESPACE` where 99 names in the project spell it `Namespace` · ×1
`matchNAMESPACE` spells `NAMESPACE` where 99 names in the project spell it `Namespace` npm/pkg/dataplane/debug/trafficanalyzer.go:374— 99 of 100 names in project github.com/Azure/azure-container-networking spell the token `Namespace` (99 of 100; unit: names in project github.com/Azure/azure-container-networking containing `Namespace`). Peers: PodNetworkInterfaceInfo.PodNamespace (cni/api/api.go:16); NetworkConfig.PodNamespaceForDualNetwork (cni/netconfig.go:68); CNSIPAMInvoker.podNamespace (cni/network/invoker_cns.go:46); MultitenancyClient.GetAllNetworkContainers(podNamespace) (cni/network/multitenancy.go:42); Multitenancy.GetAllNetworkContainers(podNamespace) (cni/network/multitenancy.go:191). Rename to `matchNamespace`. [rule N6]
D21 · Naming Consistency· `GetIpSetFromLabelKV` spells `Ip` where 528 names in the project spell it `IP` · ×1
`GetIpSetFromLabelKV` spells `Ip` where 528 names in the project spell it `IP` REDACTED:327— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `GetIPSetFromLabelKV`. [rule N6]
D21 · Naming Consistency· `AddVMIpAcceptRule` spells `Ip` where 528 names in the project spell it `IP` · ×1
`AddVMIpAcceptRule` spells `Ip` where 528 names in the project spell it `IP` ovsctl/ovsctl.go:43— 528 of 539 names in project github.com/Azure/azure-container-networking spell the token `IP` (528 of 539; unit: names in project github.com/Azure/azure-container-networking containing `IP`). Peers: NetworkConfig.DisableIPTableLock (cni/netconfig.go:74); cnsclient.RequestIPAddress (cni/network/cnsclient.go:10); cnsclient.ReleaseIPAddress (cni/network/cnsclient.go:11); network.errInvalidIPAddress (cni/network/invoker_azure.go:26); network.errInvalidGatewayIP (cni/network/invoker_cns.go:37). Rename to `AddVMIPAcceptRule`. [rule N6]
D21 · Naming Consistency· `SetOutboundSNAT` spells `SNAT` where 82 names in the project spell it `Snat` · ×1
`SetOutboundSNAT` spells `SNAT` where 82 names in the project spell it `Snat` platform/os_linux.go:146— 82 of 84 names in project github.com/Azure/azure-container-networking spell the token `Snat` (82 of 84; unit: names in project github.com/Azure/azure-container-networking containing `Snat`). Peers: NetworkConfig.EnableSnatOnHost (cni/netconfig.go:71); MultitenancyClient.DetermineSnatFeatureOnHost (cni/network/multitenancy.go:39); Multitenancy.DetermineSnatFeatureOnHost (cni/network/multitenancy.go:77); network.errSnatIP (cni/network/multitenancy.go:404); MockMultitenancy.DetermineSnatFeatureOnHost (cni/network/multitenancy_mock.go:46). Rename to `SetOutboundSnat`. [rule N6]
D21 · Naming Consistency· `setSDNRemoteARPRegKey` spells `ARP` where 29 names in the project spell it `Arp` · ×1
`setSDNRemoteARPRegKey` spells `ARP` where 29 names in the project spell it `Arp` platform/os_windows.go:269— 29 of 30 names in project github.com/Azure/azure-container-networking spell the token `Arp` (29 of 30; unit: names in project github.com/Azure/azure-container-networking containing `Arp`). Peers: ebtables.SetArpReply (ebtables/ebtables.go:46); ebtables.SetDnatForArpReplies (ebtables/ebtables.go:65); ebtables.SetArpDropRuleForIpCidr (ebtables/ebtables.go:197); LinuxBridgeEndpointClient.getArpReplyAddress (REDACTED:160); NetworkUtils.SetProxyArp (network/networkutils/networkutils_linux.go:272). Rename to `setSDNRemoteArpRegKey`. [rule N6]
D21 · Naming Consistency· `NewJsonFileStore` spells `Json` where 30 names in the project spell it `JSON` · ×1
`NewJsonFileStore` spells `Json` where 30 names in the project spell it `JSON` store/json.go:45— 30 of 31 names in project github.com/Azure/azure-container-networking spell the token `JSON` (30 of 31; unit: names in project github.com/Azure/azure-container-networking containing `JSON`). Peers: podInfo.UnmarshalJSON (cns/NetworkContainerContract.go:331); IPConfigurationStatus.MarshalJSON (cns/api.go:132); IPConfigurationStatus.UnmarshalJSON (cns/api.go:147); client.contentTypeJSON (cns/client/client.go:20); imds.imdsFormatJSON (cns/imds/client.go:56). Rename to `NewJSONFileStore`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion REDACTED:1— `(repository root)` (70057 LoC, 745 module-visible types across 143 directories) overshoots its size bounds. 1 of 12 build unit(s) (Go) overshoot their size bounds, lowering Project Cohesion to 8.3/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Scattered collaborators — 48 % of calls cross a namespace and only 45 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 104 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: network/hnswrapper/hnsv2wrapperfake.go, npm/pkg/dataplane/dpshim/dpshim.go, nmagent/requests.go, npm/metrics/prometheus-metrics.go, npm/pkg/dataplane/ipsets/ipsetmanager_windows.go, npm/iptm/iptm.go, ipam/pool.go, aitelemetry/telemetrywrapper.go (and 96 more) (114 orphaned of 272 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; 272 of the 529 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D40 · Network Egress Confinement· Egress open to every address · ×1
Egress open to every address npm/testpolicies/allow-all-from-app-backend.yaml:13— This egress rule allows every address (0.0.0.0/0 or ::/0 with no exceptions, no destination, or the world entity) on every port, so the workloads it selects can reach the cloud metadata endpoint, every cluster service and the internet as if no policy existed. Narrow it to the destination's CIDR and port, or except the private and link-local metadata ranges.
No runtime threat detection — No runtime threat-detection engine (Tetragon TracingPolicy / Falco) is committed. These observe process, file and network activity in-kernel and can alert or kill on malicious behaviour a static scan cannot catch.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
README/code drift tools/azure-npm-to-cilium-validator/README.md:13— tools/azure-npm-to-cilium-validator/README.md names Go 1.16 or later, but REDACTED:3 requires `go 1.25.0` (the lowest of 12 declarations): the code does not build on Go 1.16. 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.
Logging is not universal — Only 7/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `cilium-log-collector`, `pkgerrlint`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
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 37/50 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.
Silent fallback default on error tools/failure-agent/internal/collect/collect.go:255— `headExcerpt` 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.
Outdated: github.com/Azure/azure-container-networking — `github.com/Azure/azure-container-networking` is required at v1.9.5-0.20261103190603-871cba3f6df6 in REDACTED, but v1.9.7 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/Azure/azure-container-networking@v1.9.7 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/Azure/azure-container-networking — `github.com/Azure/azure-container-networking` is required at v1.9.4 in REDACTED, but v1.9.7 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/Azure/azure-container-networking@v1.9.7 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/Azure/azure-container-networking — `github.com/Azure/azure-container-networking` is required at v1.9.4 in REDACTED, but v1.9.7 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/Azure/azure-container-networking@v1.9.7 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/Azure/azure-sdk-for-go/sdk/azcore — `github.com/Azure/azure-sdk-for-go/sdk/azcore` is required at v1.23.3 in REDACTED, but v1.24.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/Azure/azure-sdk-for-go/sdk/azcore@v1.24.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/Microsoft/hcsshim — `github.com/Microsoft/hcsshim` is required at v0.13.0 in REDACTED, but v0.15.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/Microsoft/hcsshim@v0.15.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/containernetworking/plugins — `github.com/containernetworking/plugins` is required at v1.9.1 in REDACTED, but v1.10.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/containernetworking/plugins@v1.10.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/labstack/echo/v4 — `github.com/labstack/echo/v4` is required at v4.16.3 in REDACTED, but v4.16.5 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/labstack/echo/v4@v4.16.5 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/olekukonko/tablewriter — `github.com/olekukonko/tablewriter` is required at v0.0.5 in REDACTED, but v1.1.5 is the module's current release — so this build is missing every fix published since, including any security fix. This crosses a major version — v0 releases carry no compatibility promise, so read the changelog before taking it. Run `go get github.com/olekukonko/tablewriter@v1.1.5 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/openai/openai-go/v3 — `github.com/openai/openai-go/v3` is required at v3.91.0 in REDACTED, but v3.99.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/openai/openai-go/v3@v3.99.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/prometheus/common — `github.com/prometheus/common` is required at v0.73.1 in REDACTED, but v0.74.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/common@v0.74.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/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/sys — `golang.org/x/sys` is required at v0.49.0 in REDACTED, but v0.50.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/sys@v0.50.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: k8s.io/apiextensions-apiserver — `k8s.io/apiextensions-apiserver` is required at v0.37.0 in REDACTED, but v0.37.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get k8s.io/apiextensions-apiserver@v0.37.2 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: modernc.org/sqlite — `modernc.org/sqlite` is required at v1.61.1 in REDACTED, but v1.62.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get modernc.org/sqlite@v1.62.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: sigs.k8s.io/controller-runtime — `sigs.k8s.io/controller-runtime` is required at v0.25.2 in REDACTED, but v0.25.3 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get sigs.k8s.io/controller-runtime@v0.25.3 && 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.
Run 01a1e45f-f7d0-708b-b8af-73215b010164 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 71 · Warnings: 1573 · Recommendations: 309 · Info: 16 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 12:40 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.