Public report of openshift/hypershift, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 21:05 UTC · Survey ID cd_a46c7a539e3147caa905ac3d8737c462

openshift/hypershift

Measured 17 November 2026, 21:02 UTC, at code version 1e201ec

First survey, so nothing to compare with yet
CAI score 62.1out of 100 At risk

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 195,958 lines of product code in 21 projects, tests not counted · Estimated rebuild effort: about 3.9 person-years · Weakest lens: Production Readiness, 59.5

Findings by how serious they are

48 critical 2567 serious 355 minor

14 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 21:02 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

65of 65 dimensions measured by tools.
2823of 2970 findings point to an exact file and line, so you can open each one in the code. The other 147 concern the repository as a whole, such as missing documentation.
65dimensions across 7 lenses, read from 195,958 lines of product code in 21 projects.
Chapters

Executive summary

openshift/hypershift is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 62.1 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 59.5, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 2.4 points. Pinning the dependencies to tagged releases comes next, worth about 2.2 points. Raising Production Readiness to 70 would lift the score to about 64.2.

Twenty pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eight known security holes in the packages the code depends on can be used by attackers, and five secrets can leak from the build pipeline. Pinning each tool to an exact version, updating the vulnerable packages and limiting each secret to its own step would close these risks. Passing outside input through environment variables would fix the three pipeline steps that put outside input straight into a shell command, and the four connections that skip the certificate check need the certificate check switched back on. The two parts of the code nobody has worked on for a long time need someone to learn and document them before anyone changes them.

The product code is 195,958 lines, about €570,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 for The 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.
Production Readiness 59.5 · counts for 46%Security and Compliance 60.2 · counts for 25%Maturity 65.0 · counts for 14%Performance 68.6 · counts for 8%Accessibility 70.5 · counts for 4%Code Health 72.5 · counts for 2%Architecture 75.1 · counts for 1%

If Production Readiness rose from 59.5 to 70, the lowest score rated Strong, the score would rise from 62.1 to about 64.2.

Code composition: what the lines of code are
Product code 39%Tests 61%
Rebuild cost: about €570,000 · Estimate
Cost to rebuild€190,000 to €950,000, for 3,137 to 9,953 hours of work, about 3.9 person-years for 2 to 8 engineers
Difficulty of the problemStandard, 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 62. 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.
SizeLarge: 195,958 lines of product code
What it is notNot 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 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 2.4 points · Low effort · Secret Scanning
2
Resolve the 4 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.
Raises the score by about 2.2 points · Low effort · Dependency Hygiene
3
Resolve the 1 Banned license finding(s) in License Compliance.
Raises the score by about 2.1 points · Low effort · License Compliance

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Files that change often carry extra risk · Combined risk
28 files are changed often and are hard to read, which makes them the likeliest places for a mistake. They also have under half their code tested, or were written almost entirely by one person, so a mistake there is less likely to be caught, or only one person knows the code well enough to avoid it. A change to these files therefore carries more risk than the overall score suggests.
Based on: Churn × Complexity Hotspots (39 files) · Code Coverage (218 files under half tested) · Bus Factor (0 files written almost entirely by one person) · The files: REDACTED, reconcile_legacy.go and hostedcontrolplane_controller.go
What to do: Add tests to these files and have a second person review every change to them, starting with REDACTED, reconcile_legacy.go and hostedcontrolplane_controller.go.
Where the investment is most exposed · Value at risk
This code would cost about €570,000 to build again, about 3.9 person-years of work. Its weakest lens is Production Readiness, at 59.5 (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 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 2.4 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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 4.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 8% to 18% on every change. The history of the code shows how much it changes: about 345,401 lines over the last 90 days, which is about 1,400,793 lines a year. At that pace, the extra work comes to an estimated 277.4 to 1664.6 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 — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch github.com/openshift/cluster-api-provider-agent/api api github.com/openshift/hypershift hypershift github.com/openshift/hypershift->github.com/openshift/cluster-api-provider-agent/api github.com/openshift/hypershift/api api github.com/openshift/hypershift->github.com/openshift/hypershift/api sigs.k8s.io/cluster-api-provider-aws/v2 v2 github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-aws/v2 sigs.k8s.io/cluster-api-provider-azure cluster-api-provider-azure github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-azure sigs.k8s.io/cluster-api-provider-gcp cluster-api-provider-gcp github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-gcp sigs.k8s.io/cluster-api-provider-ibmcloud cluster-api-provider-ibmcloud github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-ibmcloud sigs.k8s.io/cluster-api-provider-kubevirt cluster-api-provider-kubevirt github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-kubevirt sigs.k8s.io/cluster-api-provider-openstack cluster-api-provider-openstack github.com/openshift/hypershift->sigs.k8s.io/cluster-api-provider-openstack github.com/openshift/hypershift/contrib/ci/gocacheprog gocacheprog github.com/openshift/hypershift/contrib/gomaxprocs-webhook gomaxprocs-webhook github.com/openshift/hypershift/hack/tools tools repo-metrics repo-metrics

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.

433 modules, with 505 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 393 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.
uses →1 github.com/openshift/hypershift/api/hypershift/v1beta12 github.com/openshift/hypershift/api/scheduling/v1alpha13 github.com/openshift/hypershift/support/config4 github.com/openshift/hypershift/support/metrics5 github.com/openshift/hypershift/support/podspec6 github.com/openshift/hypershift/support/releaseinfo7 github.com/openshift/hypershift/support/thirdparty/library-go/pkg/image/dockerv1client8 github.com/openshift/hypershift/support/upsert9 sigs.k8s.io/cluster-api-provider-openstack/api/v1beta210 github.com/openshift/hypershift/cmd/util11 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/infra12 github.com/openshift/hypershift/control-plane-pki-operator/certificates13 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster/internal/platform14 github.com/openshift/hypershift/support/capabilities15 github.com/openshift/hypershift/support/imageprovider16 github.com/openshift/hypershift/support/util/fakeimagemetadataprovider17 github.com/openshift/hypershift/cmd/infra/aws/util18 github.com/openshift/hypershift/cmd/nodepool/core19 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/oauth20 github.com/openshift/hypershift/support/imageregistry21 github.com/openshift/hypershift/cmd/cluster/core22 github.com/openshift/hypershift/cmd/infra/aws23 github.com/openshift/hypershift/cmd/nodepool/azure24 github.com/openshift/hypershift/cmd/nodepool/kubevirt25 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/operator26 github.com/openshift/hypershift/hypershift-operator/controllers/nodepool27 github.com/openshift/hypershift/ignition-server/controllers28 github.com/openshift/hypershift/support/controlplane-component29 github.com/openshift/hypershift/support/globalconfig30 github.com/openshift/hypershift/cmd/cluster/aws31 github.com/openshift/hypershift/cmd/cluster/azure32 github.com/openshift/hypershift/cmd/cluster/kubevirt33 github.com/openshift/hypershift/cmd/cluster/openstack34 github.com/openshift/hypershift/cmd/cluster/powervs35 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane36 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/kas37 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/controllers/resources38 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster39 github.com/openshift/hypershift/hypershift-operator/controllers/ignitionpayload40 github.com/openshift/hypershift/karpenter-operator/controllers/karpenterignition
1 github.com/openshift/hypershift/api/hypershift/v1beta1
2 github.com/openshift/hypershift/api/scheduling/v1alpha1
3 github.com/openshift/hypershift/support/config
4 github.com/openshift/hypershift/support/metrics
5 github.com/openshift/hypershift/support/podspec
6 github.com/openshift/hypershift/support/releaseinfo
7 github.com/openshift/hypershift/support/thirdparty/library-go/pkg/image/dockerv1client
8 github.com/openshift/hypershift/support/upsert
9 sigs.k8s.io/cluster-api-provider-openstack/api/v1beta2
10 github.com/openshift/hypershift/cmd/util1
11 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/infra2
12 github.com/openshift/hypershift/control-plane-pki-operator/certificates2
13 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster/internal/platform51
14 github.com/openshift/hypershift/support/capabilities1
15 github.com/openshift/hypershift/support/imageprovider1
16 github.com/openshift/hypershift/support/util/fakeimagemetadataprovider32
17 github.com/openshift/hypershift/cmd/infra/aws/util1
18 github.com/openshift/hypershift/cmd/nodepool/core411
19 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/oauth4311
20 github.com/openshift/hypershift/support/imageregistry2131
21 github.com/openshift/hypershift/cmd/cluster/core11511
22 github.com/openshift/hypershift/cmd/infra/aws156
23 github.com/openshift/hypershift/cmd/nodepool/azure516
24 github.com/openshift/hypershift/cmd/nodepool/kubevirt816
25 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/operator11111
26 github.com/openshift/hypershift/hypershift-operator/controllers/nodepool244111
27 github.com/openshift/hypershift/ignition-server/controllers1111
28 github.com/openshift/hypershift/support/controlplane-component11221232
29 github.com/openshift/hypershift/support/globalconfig7323
30 github.com/openshift/hypershift/cmd/cluster/aws21295
31 github.com/openshift/hypershift/cmd/cluster/azure3291
32 github.com/openshift/hypershift/cmd/cluster/kubevirt2182
33 github.com/openshift/hypershift/cmd/cluster/openstack218
34 github.com/openshift/hypershift/cmd/cluster/powervs319
35 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane61311112
36 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/kas81113
37 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/controllers/resources6211
38 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster2123211111
39 github.com/openshift/hypershift/hypershift-operator/controllers/ignitionpayload422
40 github.com/openshift/hypershift/karpenter-operator/controllers/karpenterignition5211
Uses a module listed above itPart of a loopThe module itself
1 github.com/openshift/hypershift/api/hypershift/v1beta12 github.com/openshift/hypershift/api/scheduling/v1alpha13 github.com/openshift/hypershift/support/config4 github.com/openshift/hypershift/support/metrics5 github.com/openshift/hypershift/support/podspec6 github.com/openshift/hypershift/support/releaseinfo7 github.com/openshift/hypershift/support/thirdparty/library-go/pkg/image/dockerv1client8 github.com/openshift/hypershift/support/upsert9 sigs.k8s.io/cluster-api-provider-openstack/api/v1beta210 github.com/openshift/hypershift/cmd/util11 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/infra12 github.com/openshift/hypershift/control-plane-pki-operator/certificates13 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster/internal/platform14 github.com/openshift/hypershift/support/capabilities15 github.com/openshift/hypershift/support/imageprovider16 github.com/openshift/hypershift/support/util/fakeimagemetadataprovider17 github.com/openshift/hypershift/cmd/infra/aws/util18 github.com/openshift/hypershift/cmd/nodepool/core19 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/oauth20 github.com/openshift/hypershift/support/imageregistry21 github.com/openshift/hypershift/cmd/cluster/core22 github.com/openshift/hypershift/cmd/infra/aws23 github.com/openshift/hypershift/cmd/nodepool/azure24 github.com/openshift/hypershift/cmd/nodepool/kubevirt25 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/operator26 github.com/openshift/hypershift/hypershift-operator/controllers/nodepool27 github.com/openshift/hypershift/ignition-server/controllers28 github.com/openshift/hypershift/support/controlplane-component29 github.com/openshift/hypershift/support/globalconfig30 github.com/openshift/hypershift/cmd/cluster/aws31 github.com/openshift/hypershift/cmd/cluster/azure32 github.com/openshift/hypershift/cmd/cluster/kubevirt33 github.com/openshift/hypershift/cmd/cluster/openstack34 github.com/openshift/hypershift/cmd/cluster/powervs35 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane36 github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/kas37 github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/controllers/resources38 github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster39 github.com/openshift/hypershift/hypershift-operator/controllers/ignitionpayload40 github.com/openshift/hypershift/karpenter-operator/controllers/karpenterignitiongithub.com/openshift/hypershift/api/hypershift/v1beta11github.com/openshift/hypershift/api/scheduling/v1alpha12github.com/openshift/hypershift/support/config3github.com/openshift/hypershift/support/metrics4github.com/openshift/hypershift/support/podspec5github.com/openshift/hypershift/support/releaseinfo6github.com/openshift/hypershift/support/thirdparty/library-go/pkg/image/dockerv1client7github.com/openshift/hypershift/support/upsert8sigs.k8s.io/cluster-api-provider-openstack/api/v1beta29github.com/openshift/hypershift/cmd/util10github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/infra11github.com/openshift/hypershift/control-plane-pki-operator/certificates12github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster/internal/platform13github.com/openshift/hypershift/support/capabilities14github.com/openshift/hypershift/support/imageprovider15github.com/openshift/hypershift/support/util/fakeimagemetadataprovider16github.com/openshift/hypershift/cmd/infra/aws/util17github.com/openshift/hypershift/cmd/nodepool/core18github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/oauth19github.com/openshift/hypershift/support/imageregistry20github.com/openshift/hypershift/cmd/cluster/core21github.com/openshift/hypershift/cmd/infra/aws22github.com/openshift/hypershift/cmd/nodepool/azure23github.com/openshift/hypershift/cmd/nodepool/kubevirt24github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/operator25github.com/openshift/hypershift/hypershift-operator/controllers/nodepool26github.com/openshift/hypershift/ignition-server/controllers27github.com/openshift/hypershift/support/controlplane-component28github.com/openshift/hypershift/support/globalconfig29github.com/openshift/hypershift/cmd/cluster/aws30github.com/openshift/hypershift/cmd/cluster/azure31github.com/openshift/hypershift/cmd/cluster/kubevirt32github.com/openshift/hypershift/cmd/cluster/openstack33github.com/openshift/hypershift/cmd/cluster/powervs34github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane35github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/kas36github.com/openshift/hypershift/control-plane-operator/hostedclusterconfigoperator/controllers/resources37github.com/openshift/hypershift/hypershift-operator/controllers/hostedcluster38github.com/openshift/hypershift/hypershift-operator/controllers/ignitionpayload39github.com/openshift/hypershift/karpenter-operator/controllers/karpenterignition401225111321411431121311151115651681611111244111111111221232732321295329121822183196131111281113621121232111114225211+393 more modules (most-connected shown)

At a glance — Code Health · 72.5 · Adequate · gated by D1, D2 ·

At a glance — Architecture · 75.1 · Strong ·

At a glance — Maturity · 65.0 · Adequate ·

At a glance — Readiness · 59.5 · Adequate · gated by P7 ·

At a glance — Security · 60.2 · Adequate · gated by D29, D36 ·

At a glance — Accessibility · 70.5 · Adequate · gated by AC4 ·

At a glance — Performance · 68.6 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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 categoryFindingsSeverity
A05:2025 — Injection147High / Critical
A03:2025 — Software Supply Chain Failures82High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED; Resolve the 4 Dependency pinned to a stale untagged commit 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.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+2.4 ptsLowSecret Scanning
Resolve the 4 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+2.2 ptsLowDependency Hygiene
Resolve the 1 Banned license finding(s) in License Compliance.+2.1 ptsLowLicense Compliance
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED.+0.6 ptsLowStatic Analysis (SAST)
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.+2.2 ptsMediumOutbound HTTP resilience
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.+1.1 ptsLowADR Quality
Resolve the 398 Low coverage finding(s) in Code Coverage — start with component.go (37), REDACTED (23), destroy.go (14).+2.0 ptsHighCode Coverage
Resolve the 1 No go.sum committed (hack/tools/deadcode-report/testdata/reachability/go… finding(s) in Dependency Hygiene.+0.9 ptsLowDependency Hygiene

File quality

Per-file score 0–10 — a quality signature. Of 807 files carrying findings, judged against the Production bar: 1% slop · 54% mixed · 45% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.1SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED2.8SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED3.1SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED3.5SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
cmd/infra/aws/create.go4.0MixedCyclomatic Complexity: CreateInfraOptions.createPerZoneResources (cyclomatic 18)
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
cmd/infra/aws/create_iam.go4.4MixedCyclomatic Complexity: CreateIAMOptions.CreateIAM (cyclomatic 18)
REDACTED4.9MixedStatic 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 — 48

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 2567

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 355

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 14

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 65 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, 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 — 65 dimensions across the health lenses
D1D2D3D4D5D6D8D11D12D13D14D15D16D17D19D20D21D22D26D27D28D29D30D34D35D36D40D41D42D43D44AC1AC2AC3AC4AC5AX10AX2AX3AX4AX6M1M2M3M4P1P10P2P3P4P5P6P7PF1PF3X14X19X2X26X27X28X3X30X4X5

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
  1. 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, 2823 of 2970 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.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. 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.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1eb51-9170-7e82-998d-33ecf88ad163.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

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.

  • D14 License Compliance — 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 repository declares a Go module (REDACTED/go.sum), but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its Go dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — 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.
  • 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.
  • D22 Internal API 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. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D31 IaC & Container Security — 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. IaC & Container Security couldn't be assessed within its 8-minute budget on a solution this large — not included in this run.
  • D41 Kernel & Syscall Confinement — 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. Control-plane-operator/controllers/hostedcontrolplane/v2/assets/capi-provider/deployment.yaml:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
  • AC6 Visual & motion safety — 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. Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository. Engine failure: ArgumentOutOfRangeException: startIndex cannot be larger than length of string. (Parameter 'startIndex').
  • 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 DockerCompose (vendor/github.com/goccy/go-json/docker-compose.yml). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — container go-json-go-json-1 exited (1); 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 this repository's Go, Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Go, Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • X1 Async 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'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.
  • X10 Duplicated predicate — 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. 58 further occurrence(s) are not listed individually; the score already reflects all 98.
  • 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.
  • 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. 31 further occurrence(s) are not listed individually; the score already reflects all 71.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 12 further occurrence(s) are not listed individually; the score already reflects all 52.

Repo exclusion declarations: 16 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • 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.
  • 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 Dockerfile (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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • 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.
  • 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.

Dimensions

D1 · Cyclomatic Complexity2.9 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.9 / 10 · rule-coverage 100% · ceiling Prevented

240 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was HostedClusterReconciler.reconcileLegacy at 336. 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 azure.sortResourcesByDeletionOrder at 16 — they are counted neither in the figure above nor in this dimension's score.

RawCreateOptions.Validate (cyclomatic 20) · ×2cmd/cluster/gcp/create.go:165
oauth.transportForCARef (cyclomatic 19) · ×2REDACTED:642
HostedClusterReconciler.reconcileLegacy (cyclomatic 336)hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56
HostedClusterReconciler.reconcile (cyclomatic 205)REDACTED:462
HostedClusterReconciler.delete (cyclomatic 48)REDACTED:4119

+ 233 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with HostedClusterReconciler.reconcileLegacy (cyclomatic 336), HostedClusterReconciler.reconcile (cyclomatic 205). — 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 2 together lifts Cyclomatic Complexity from 2.9 to about 5.7/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.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

469 method(s) exceeded the cognitive complexity threshold of 15; the worst was HostedClusterReconciler.reconcileLegacy at 621.

oauth.transportForCARef (cognitive 32) · ×2REDACTED:642
oauth.convertOpenIDIDP (cognitive 16) · ×2REDACTED:280
IngressRule.Equals (cognitive 16) · ×2pkg/capi/aws/api/v1beta1/network_types.go:490
HostedClusterReconciler.reconcileLegacy (cognitive 621)hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56
HostedClusterReconciler.reconcile (cognitive 365)REDACTED:462

+ 461 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 12 bodies over 60 down to 60 or less in Cognitive Complexity — start with HostedClusterReconciler.reconcileLegacy (cognitive 621), HostedClusterReconciler.reconcile (cognitive 365), main.crossFileCascade (cognitive 94). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 12 together lifts Cognitive Complexity from 2.0 to about 3.6/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.

D3 · God Classes8.5 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Prevented

105 god class(es) detected.

FileTooLong: REDACTED · ×40REDACTED
MethodTooLong: HostedClusterReconciler.reconcileLegacy · ×20hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56
ClassTooLong: HostedClusterReconciler · ×19REDACTED:173
TooManyMethods: HostedClusterReconciler · ×9REDACTED:173
TooManyFields: Options · ×9cmd/install/install.go:89

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 40 FileTooLong finding(s) in God Classes — start with REDACTED (3), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (40 warning-level).
  2. Resolve the 20 MethodTooLong finding(s) in God Classes — start with hypershift_operator.go (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (20 warning-level).
  3. Resolve the 19 ClassTooLong finding(s) in God Classes — start with REDACTED (3), REDACTED, hostedcontrolplane_controller.go. — One of this dimension's main actionable groups (19 warning-level).

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication4.7 / 10Weak✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 4.7 / 10 · rule-coverage 100% · ceiling Verified

481 duplicated block group(s) detected. 13.2 % of the production lines (25,832 of 195,958) are in a reported copy. A further 293 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (8 lines × 2) · ×40cmd/oadp/backup.go:252
Duplicated block (9 lines × 2) · ×36cmd/cluster/agent/create.go:54
Duplicated block (10 lines × 2) · ×33cmd/cluster/azure/destroy.go:136
Duplicated block (6 lines × 2) · ×28cmd/cluster/kubevirt/destroy.go:20
Duplicated block (13 lines × 2) · ×27cmd/infra/aws/iam.go:1295

+ 226 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 40 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (6), resources.go (3), REDACTED (3). — One of this dimension's main actionable groups (40 warning-level).
  2. Resolve the 36 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with deployment.go (4), REDACTED (3), awsprivatelink_controller.go (2). — One of this dimension's main actionable groups (36 warning-level).
  3. Resolve the 33 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), awsprivatelink_controller.go (2), service.go (2). — One of this dimension's main actionable groups (33 warning-level).

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling5.1 / 10Adequate✓ 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.

Maturity: Documented → Verified → Prevented · effective 5.1 / 10 · rule-coverage 100% · ceiling Prevented

13 production modules (Go+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence.

Off the main sequence: github.com/openshift/cluster-api-provider-agent/api · ×8

What to do

  1. Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 warning-level).

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)9.7 / 10Stronggated by 6 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

6 of 223 classes have LCOM4 above 3.

Low cohesion: NodePoolReconciler (LCOM4 9) · ×6hypershift-operator/controllers/nodepool/nodepool_controller.go:112

What to do

  1. Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with nodepool_controller.go, openstackcluster_types.go, REDACTED. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D8 · Code Coverage8.2 / 10Strong✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.2 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 44.9% — 398 file(s) below 50%. Measured from the Go suite (github.com/openshift/hypershift: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/openshift/hypershift/api: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/openshift/hypershift/contrib/ci/gocacheprog: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/openshift/hypershift/contrib/gomaxprocs-webhook: `go test -coverprofile -coverpkg=./...`, the 3 run(s) test reliability made; github.com/openshift/hypershift/hack/tools: `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.

Low coverage: REDACTED · ×398REDACTED:1

What to do

  1. Resolve the 398 Low coverage finding(s) in Code Coverage — start with component.go (37), REDACTED (23), destroy.go (14). — One of this dimension's main actionable groups (398 warning-level).

Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). Go (5 modules): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene6.0 5.4 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.4 / 10 · rule-coverage 89% · ceiling Verified

112 outdated, 0 author-deprecated direct Go module(s), 12 pinning or checksum defect(s). 186 of 186 direct requirement(s) were graded against proxy.golang.org (0 not served there, 20 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Dependency pinned to a stale untagged commit: github.com/armon/go-socks5 · ×4
No go.sum committed (hack/tools/deadcode-report/testdata/reachability/REDACTED)
No go.sum committed (REDACTED)
No go.sum committed (REDACTED)
No go.sum committed (REDACTED)

+ 5 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 4 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (4 warning-level).
  2. Resolve the 1 No go.sum committed (hack/tools/deadcode-report/testdata/reachability/go… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No go.sum committed (REDACTED) 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.

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 45 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 6 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (39 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 3 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares a Go module (REDACTED/go.sum), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: ansible-core

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 55 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: REDACTED (35×205=7175); hypershift-operator/controllers/hostedcluster/reconcile_legacy.go (15×336=5040); control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go (37×29=1073) Repeated repair below the complexity floor: cmd/nodepool/gcp/create.go (9 of 11 changes were fixes); control-plane-operator/controllers/hostedcontrolplane/v2/router/component.go (6 of 8 changes were fixes); control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go (4 of 7 changes were fixes)

Hotspot: REDACTED · ×49REDACTED:462
Repeated repair: cmd/nodepool/gcp/create.go · ×6cmd/nodepool/gcp/create.go:135

What to do

  1. Resolve the 49 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (6), REDACTED (4), deployment.go (2). — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 6 Repeated repair finding(s) in Churn × Complexity Hotspots — start with REDACTED, component.go, deployment.go. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.2 / 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.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

44 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is hypershift-operator/controllers/platform/azure/controller.go. Counted over 610 of the 1148 production source files in this repository: 535 are under the ~2,400-byte size floor this dimension measures over, and the remaining 3 have no attributable history left to measure.

Off-boarding risk: anonymized user #1 · ×2
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.

D17 · Explicit Debt9.7 / 10Stronggated by 265 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Prevented

265 deducted task-comment markers across 195958 LoC (0.1/KLoC) → score 9.7. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×260test/integration/control_plane_pki_operator.go:46
FixmeComment · ×4test/e2e/util/util.go:2071
XxxCommentsupport/config/cipher_test.go:184

What to do

  1. Resolve the 260 TodoComment finding(s) in Explicit Debt — start with hostedcluster_types.go (14), REDACTED (12), capi.go (11). — One of this dimension's main actionable groups (260 warning-level).
  2. Resolve the 4 FixmeComment finding(s) in Explicit Debt — start with capi.go (2), REDACTED, setup.go. — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 1 XxxComment finding(s) in Explicit Debt — start with cipher_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.

D19 · Documentation Quality8.8 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

0 of 1 documentation facets pass in full; short on: F2 example. 380 document(s) read across 80 unit(s).

Documentation: no build, run or usage exampleignition-server/README.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs foundREDACTED:17

What to do

  1. 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.

D21 · Naming Consistency7.8 / 10Strong✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 7.8 / 10 · rule-coverage 100% · ceiling Verified

20 naming inconsistencies among 913 declarations measured against a convention their peers follow.

`GlobalPullSecretDSName` spells `DS` where 34 names in the project spell it `Ds` · ×2control-plane-operator/hostedclusterconfigoperator/controllers/resources/manifests/pullsecret.go:9
`DirectKubeApiServiceAccess` spells `Api` where 178 names in the project spell it `API`REDACTED:83
`DrOidcIamOptions` spells `Iam` where 44 names in the project spell it `IAM`REDACTED:84
`NewDrOidcIamCommand` spells `Iam` where 44 names in the project spell it `IAM`REDACTED:109
`AccessKeyId` spells `Id` where 425 names in the project spell it `ID`cmd/infra/aws/util/sts.go:89

+ 14 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 `GlobalPullSecretDSName` spells `DS` where 34 names in the project spell… finding(s) in Naming Consistency — start with pullsecret.go (2). — One of this dimension's main actionable groups (2 recommendation-level).
  2. Resolve the 1 `DirectKubeApiServiceAccess` spells `Api` where 178 names in the project… finding(s) in Naming Consistency — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `DrOidcIamOptions` spells `Iam` where 44 names in the project spell it… finding(s) in Naming Consistency — start with REDACTED. — 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.

D22 · Internal API Consistency9.3 / 10Stronggated by 9 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.

Maturity: Documented → Verified → Prevented · effective 9.3 / 10 · rule-coverage 100% · ceiling Verified

9 API inconsistencies among 1372 exposed members measured against a convention their peers follow.

`CreateInfraOptions.Output` takes no context.Context; its 13 sibling operations take onecmd/infra/aws/create.go:169
`CreateIAMOptions.Output` takes no context.Context; its 9 sibling operations take onecmd/infra/aws/create_iam.go:153
`util.DefaultGCPMachineType` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use `(T, error)` (an error when absent)cmd/util/gcp.go:20
`HostedControlPlaneReconciler.SetupWithManager` takes no context.Context; its 3 sibling operations take onecontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:223
`nodepool.GetRHELStream` takes no context.Context; its 5 sibling operations take onehypershift-operator/controllers/nodepool/stream.go:22

+ 4 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 `CreateInfraOptions.Output` takes no context.Context; its 13 sibling… finding(s) in Internal API Consistency — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 `CreateIAMOptions.Output` takes no context.Context; its 9 sibling… finding(s) in Internal API Consistency — start with create_iam.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 `util.DefaultGCPMachineType` signals absence with a bare `T` (the zero… finding(s) in Internal API Consistency — start with gcp.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.

D26 · Project Cohesion6.2 / 10Adequate✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 6.2 / 10 · rule-coverage 100% · ceiling Documented

4 of 21 build units (Go, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4REDACTED:1

What to do

  1. Resolve the 4 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (4). — One of this dimension's main actionable groups (4 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D27 · Navigability9.8 / 10Exemplary✓ 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.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

40 % of calls cross a namespace and 3 % go through an interface, but 99 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.0 / 10Critical✓ Tool-verified

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).

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

147 finding(s): 0 critical, 36 high, 100 medium, 11 low. 20 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 8 file(s) — `api/hypershift/v1beta1/zz_generated.deepcopy.go`, `contrib/migration/migrate-hcp.sh` (lines 3–403), `hack/capi-crd-gen.sh` (line 28), `hack/capi-sync-provider.sh` (line 29), `hack/tools/git-hooks/cpo-containerfiles-in-sync.sh` (line 2), … (+3 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 8 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

+ 22 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. No action in Static Analysis (SAST) — all 20 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (20 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

77 finding(s): 2 critical, 6 high, 69 medium, 0 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 6 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.1 / 10Adequategated by 2 critical findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Documented

50 of 613 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is cmd/infra/powervs/create.go. Counted over 613 of the 1148 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×2cmd/infra/powervs/create.go:1
Orphaned file · ×48cmd/cluster/powervs/create.go:1
Further orphaned files (smaller)

What to do

  1. Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with REDACTED, destroy.go. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 48 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED (3), clustersizingconfiguration_types.go, imagecacher.go. — One of this dimension's main actionable groups (48 recommendation-level).
  3. 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.

D35 · Change Coupling9.9 / 10Stronggated by 2 serious findings✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: hostedcontrolplane_controller.go↔deployment.go 55%; reconcile.go↔hostedcontrolplane_controller.go 53%; providerconfig.go↔hostedcontrolplane_controller.go 50%

Change-coupling hub: hostedcontrolplane_controller.go → providerconfig.go, providerconfig.go, reconcile.go, deployment.gocontrol-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go
Change coupling: deployment.go ↔ params.gocontrol-plane-operator/controllers/hostedcontrolplane/oauth/deployment.go:1

What to do

  1. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with hostedcontrolplane_controller.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Change coupling finding(s) in Change Coupling — start with deployment.go. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. 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.

D40 · Network Egress Confinement10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Kubernetes workloads are covered by a network policy that restricts egress.

✓ On the Gold path — maintain.

Detailed fixes: d40_recommendation.md.

D41 · Kernel & Syscall Confinement6.2 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.2 / 10 · rule-coverage 100% · ceiling Documented

5/60 workload(s) run every container under a seccomp profile; 0/60 declare an AppArmor/SELinux profile.

No seccomp profile · ×55REDACTED:2

What to do

  1. Resolve the 55 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED (47), REDACTED, REDACTED. — One of this dimension's main actionable groups (55 recommendation-level).

Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.

D42 · Runtime Threat Enforcement6.0 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Documented

0/2 runtime-enforcement controls present (threat detection, admission control).

No runtime threat detection
No admission-control policy

What to do

  1. Resolve the 1 No runtime threat detection finding(s) in Runtime Threat Enforcement. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 No admission-control policy 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.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 21 platform declaration(s) and 6 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.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC3 · Page structure10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A positive tabindex forces a manual tab order that fights the DOM and is fragile. Use tabindex="0" (or restructure the DOM). (×3) — control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:275, control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:282, control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:285

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AX10 · Code composition4.0 / 10Weak✓ Tool-verified

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.

AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

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.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

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.

M1 · Documentation (README)4.5 / 10Weak✓ Tool-verified

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.

  • The root README is 61 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers. — README.md:1

What to do

  • Expand the README with getting-started, architecture overview and a project map.
  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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.
  • `docs/content/reference/cluster-teardown-roadmap.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `kubeconfig`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/content/reference/cluster-teardown-roadmap.md:28
  • `docs/content/reference/controller-architecture.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `destroy`, `iam`, `kubeconfig`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/content/reference/controller-architecture.md:18
  • `docs/content/getting-started/onboarding/lifecycle.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/content/getting-started/onboarding/lifecycle.md:14
  • `docs/content/images/cluster-lifecycle/startup-debugging-decision-tree.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `cluster`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/content/images/cluster-lifecycle/startup-debugging-decision-tree.mmd:1
  • `docs/content/images/cluster-lifecycle/startup-dependency-graph.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — docs/content/images/cluster-lifecycle/startup-dependency-graph.mmd:1

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.
  • Update docs/content/reference/cluster-teardown-roadmap.md so it draws the parts the code has today: add create, kubeconfig.
  • Update docs/content/reference/controller-architecture.md so it draws the parts the code has today: add destroy, iam, kubeconfig.
  • Update docs/content/getting-started/onboarding/lifecycle.md so it draws the parts the code has today: add create, destroy, iam.
  • Update docs/content/images/cluster-lifecycle/startup-debugging-decision-tree.mmd so it draws the parts the code has today: add cluster, destroy, iam.
  • Update docs/content/images/cluster-lifecycle/startup-dependency-graph.mmd so it draws the parts the code has today: add create, destroy, iam.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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.

M4 · Documentation accuracy8.0 / 10Strong✓ Tool-verified

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.

  • docs/content/getting-started/quick-setup.md names Go 1.19, but REDACTED:3 requires `go 1.24` (the lowest of 21 declarations): the code does not build on Go 1.19. 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. — docs/content/getting-started/quick-setup.md:17

What to do

  • Reconcile the README with reality: docs/content/getting-started/quick-setup.md names Go 1.19, but REDACTED:3 requires `go 1.24` (the lowest of 21 declarations): the code does not build on Go 1.19.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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.

P2 · Observability8.5 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 2/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `contrib/repo_metrics`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling7.0 / 10Strong✓ Tool-verified

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.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

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.

P5 · DR & Backup7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

What to do

  • No persistence guard on critical data stores — use Docker named volumes (or your orchestrator's persistent-volume equivalent) so the data store can't be wiped by a container recreate (or, in cloud, set purge-protection / soft-delete / prevent_destroy).
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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.

P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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.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. (×4) — cmd/infra/powervs/destroy.go:680, hack/tools/release/notes.go:142, support/forwarder/forwarder.go:45, …
  • `requests.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. — contrib/repo_metrics/weekly_pr_report.py:511

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.
  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
PF1 · Benchmark discipline8.0 / 10Strong✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

  • A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured. — hack/tools/hypershiftlinter/analyzers/testfuncstructure/testdata/src/a/good/production_test.go

What to do

  • Call b.ReportAllocs() in the benchmarks, or run them with `go test -bench . -benchmem`, so allocation regressions are visible, not just time.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `_fetch_json` is async and calls requests.post, requests.get, time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — contrib/repo_metrics/weekly_pr_report.py:87
  • `_github_graphql_request` is async and calls requests.post, time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — contrib/repo_metrics/weekly_pr_report.py:410
  • `fetch_repository_contributors` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — contrib/repo_metrics/weekly_pr_report.py:478
  • `fetch_release_prs_graphql` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — contrib/repo_metrics/weekly_pr_report.py:616

What to do

  • Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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.

X2 · Cancellation propagation9.7 / 10Exemplary✓ Tool-verified

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 22/23 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.
  • `makeRequest` 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, …)`. — hack/tools/release/notes.go:134

What to do

  • Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

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.

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.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X3 · Exception handling7.7 / 10Strong✓ Tool-verified

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` 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. (×23) — support/upsert/apply.go:313, support/upsert/apply.go:317, support/releaseinfo/fake/fake.go:166, …
  • `body, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `body` as if the call succeeded. When `io.ReadAll` fails, `body` 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 `body` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — support/releaseinfo/cincinnati_version_resolver.go:127
  • `if err := client.Get(ctx, types.NamespacedName{Namespace: hc.Namespace, Name: hc.Spec.PullSecret.Name}, &pullSecret); 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. — support/releaseinfo/fake/fake.go:158
  • `if err := sigyaml.Unmarshal(manifest, &meta); 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. — support/backwardcompat/backwardcompat.go:69
  • `if err := c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: CASecretName}, ca); 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. — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:389
  • `if err := c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: ServingCertSecretName}, serving); 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. — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:397
  • `if err := r.List(ctx, hostedClusters); 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. (×2) — REDACTED:44, REDACTED:356
  • `if err := r.List(ctx, otherReqServingNodes, client.MatchingLabels{pkgscheduler.OSDFleetManagerPairedNodesLabel: pairLabel}); 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:395
  • `_, candidateCIDR, _ := net.ParseCIDR(candidate)` writes the call's error to `_` and then uses `candidateCIDR` as if the call succeeded. When `net.ParseCIDR` fails, `candidateCIDR` 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 `candidateCIDR` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — hypershift-operator/controllers/platform/azure/controller.go:856
  • `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. (×4) — hypershift-operator/controllers/nodepool/capi.go:239, hypershift-operator/controllers/nodepool/token.go:260, hypershift-operator/controllers/nodepool/token.go:279, …
  • `if err := r.List(ctx, nodePoolList, client.InNamespace(cm.Namespace)); 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. — hypershift-operator/controllers/nodepool/nodepool_controller.go:1134
  • `if err := r.List(ctx, nodePoolList, client.InNamespace(hc.Namespace)); 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. — hypershift-operator/controllers/nodepool/nodepool_controller.go:1212
  • `if err := r.List(ctx, list, client.InNamespace(namespace)); 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. — hypershift-operator/controllers/ignitionpayload/watches.go:45
  • `isTrue, _ := strconv.ParseBool(val)` writes the call's error to `_` and then uses `isTrue` as if the call succeeded. When `strconv.ParseBool` fails, `isTrue` 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 `isTrue` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line. — REDACTED:4773

What to do

  • Swallowed exception (caught, then discarded)
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.

X4 · Structured logging7.2 / 10Strong✓ Tool-verified

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 240 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. — sync-global-pullsecret/sync-global-pullsecret.go:240
  • `Info` at line 398 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. — REDACTED:398
  • `Info` at line 409 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. — REDACTED:409
  • `Info` at line 429 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. — REDACTED:429
  • `Info` at line 555 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. — support/imageregistry/imagemetadata.go:555
  • `Info` at line 351 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. — support/capi-crdmigrator/crd_migrator.go:351
  • `Info` at line 403 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. — support/capi-crdmigrator/crd_migrator.go:403
  • `Info` at line 290 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. — REDACTED:290
  • `Info` at line 301 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. — REDACTED:301
  • `Info` at line 412 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. — REDACTED:412
  • `Info` at line 423 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. — REDACTED:423
  • `Info` at line 458 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. — REDACTED:458
  • `Error` at line 200 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. — hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:200
  • `Info` at line 823 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. — hypershift-operator/controllers/hostedcluster/network_policies.go:823
  • `Error` at line 469 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. — control-plane-operator/main.go:469
  • `Error` at line 476 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. — control-plane-operator/main.go:476
  • `Error` at line 483 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. — control-plane-operator/main.go:483
  • `Error` at line 490 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. — control-plane-operator/main.go:490
  • `Info` at line 55 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. (×2) — control-plane-operator/hostedclusterconfigoperator/controllers/usercabundle/usercabundle.go:55, control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:55
  • `Info` at line 378 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. — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:378
  • `Error` at line 1439 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. — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1439
  • `Info` at line 3143 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. — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:3143
  • `Info` at line 168 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. — control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:168
  • `Info` at line 223 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. — control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:223
  • `Info` at line 389 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. — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:389
  • `Info` at line 769 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. — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:769
  • `Info` at line 28 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:28
  • `Info` at line 32 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:32
  • `Info` at line 36 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:36
  • `Info` at line 41 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:41
  • `Info` at line 51 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:51
  • `Info` at line 85 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:85
  • `Info` at line 209 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:209
  • `Info` at line 242 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:242
  • `Info` at line 249 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:249
  • `Info` at line 344 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:344
  • `Info` at line 383 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:383
  • `Info` at line 390 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. — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:390
  • `Info` at line 174 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. — cmd/infra/aws/destroy.go:174

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

WCAG coverage — what static analysis assessed

Statically assessed 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal

Not statically assessed — these 42 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.3, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.7, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health72.5Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture75.1StrongStrongest area.
Maturity65.0AdequateAcceptable, with room to improve.
Readiness59.5Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security60.2Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility70.5Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance68.6AdequateAcceptable, with room to improve.
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 — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 48 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.

  • AC6 Visual & motion safety — Visual & motion safety could not be assessed in this run — the check did not complete, so it is not scored. This is a gap in the analyzer, not a finding about this repository.
  • AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 1 — a container did not start, exited, or never became healthy) — container go-json-go-json-1 exited (1); 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 — ~312769 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 (hypershift-operator), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .go, .py source were not judged.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — IaC & Container Security not included (time budget)
  • 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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 (3 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); 5 strongly-typed id(s); 8 value object(s)
  • ED1 Event-Driven — not scored — this repository shows only 1 of the 3 signals this lens looks for (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 1212 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.
  • 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 — X1 reached only 2% of this repository's production lines — go (191,886 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X12 Unreachable branch — X12 reached only 2% of this repository's production lines — go (191,886 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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.

Critical — 48 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×2
  • Orphaned knowledge cmd/infra/powervs/create.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 cmd/infra/powervs/destroy.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.
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D14 · License Compliance · Banned license · ×1
  • Banned license: ansible-core — `ansible-core` 2.22.0 is published on PyPI under `GPL-3.0-or-later`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
Serious — 2567 finding(s)
D8 · Code Coverage · Low coverage · ×398
  • Low coverage: REDACTED REDACTED:1 — 0.0% line coverage (0/169).
  • Low coverage: cmd/bastion/aws/create.go cmd/bastion/aws/create.go:1 — 8.9% line coverage (46/515).
  • Low coverage: cmd/bastion/aws/destroy.go cmd/bastion/aws/destroy.go:1 — 26.9% line coverage (39/145).
  • Low coverage: cmd/bastion/create.go cmd/bastion/create.go:1 — 0.0% line coverage (0/9).
  • Low coverage: cmd/bastion/destroy.go cmd/bastion/destroy.go:1 — 0.0% line coverage (0/9).
  • Low coverage: cmd/cluster/aws/destroy.go cmd/cluster/aws/destroy.go:1 — 31.3% line coverage (45/144).
  • Low coverage: REDACTED REDACTED:1 — 31.5% line coverage (237/752).
  • Low coverage: cmd/cluster/gcp/destroy.go cmd/cluster/gcp/destroy.go:1 — 34.6% line coverage (9/26).
  • Low coverage: cmd/cluster/powervs/destroy.go cmd/cluster/powervs/destroy.go:1 — 38.2% line coverage (39/102).
  • Low coverage: cmd/consolelogs/aws/getlogs.go cmd/consolelogs/aws/getlogs.go:1 — 27.7% line coverage (31/112).
  • Low coverage: cmd/consolelogs/azure/api_journals.go cmd/consolelogs/azure/api_journals.go:1 — 41.3% line coverage (52/126).
  • Low coverage: cmd/consolelogs/logs.go cmd/consolelogs/logs.go:1 — 0.0% line coverage (0/8).
  • Low coverage: cmd/create/create.go cmd/create/create.go:1 — 0.0% line coverage (0/19).
  • Low coverage: cmd/destroy/destroy.go cmd/destroy/destroy.go:1 — 0.0% line coverage (0/13).
  • Low coverage: REDACTED REDACTED:1 — 21.9% line coverage (138/630).
  • Low coverage: cmd/fix/fix.go cmd/fix/fix.go:1 — 0.0% line coverage (0/20).
  • Low coverage: cmd/infra/aws/create.go cmd/infra/aws/create.go:1 — 0.0% line coverage (0/538).
  • Low coverage: cmd/infra/aws/create_cli_role.go cmd/infra/aws/create_cli_role.go:1 — 0.0% line coverage (0/76).
  • Low coverage: cmd/infra/aws/create_iam.go cmd/infra/aws/create_iam.go:1 — 0.0% line coverage (0/170).
  • Low coverage: cmd/infra/aws/create_operator_roles.go cmd/infra/aws/create_operator_roles.go:1 — 0.0% line coverage (0/222).
  • Low coverage: cmd/infra/aws/delegatingclientgenerator/main.go cmd/infra/aws/delegatingclientgenerator/main.go:1 — 0.0% line coverage (0/268).
  • Low coverage: cmd/infra/aws/destroy.go cmd/infra/aws/destroy.go:1 — 0.0% line coverage (0/652).
  • Low coverage: cmd/infra/aws/destroy_iam.go cmd/infra/aws/destroy_iam.go:1 — 0.0% line coverage (0/272).
  • Low coverage: cmd/infra/aws/ec2.go cmd/infra/aws/ec2.go:1 — 0.0% line coverage (0/520).
  • Low coverage: cmd/infra/aws/iam.go cmd/infra/aws/iam.go:1 — 0.0% line coverage (0/684).
  • + 373 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×260
  • TodoComment test/integration/control_plane_pki_operator.go:46 — // TODO(GCP): Revisit. GKE Warden blocks CSRs with system: prefix in CN — 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/placeholder_test.go:38 — // TODO: when/if we ever run all of these in parallel, this will collide with the hosted cluster sizing test on apply — 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/framework/hosted-cluster.go:200 — // TODO: logs from the HostedCluster namespace - can we reuse e2e? — 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/framework/hosted-cluster.go:215 — // TODO: logs from the HostedCluster namespace - can we reuse e2e? — 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/framework/options.go:122 — // TODO: stream logs for all of the components into artifacts — 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/framework/options.go:123 — // TODO: dump yamls into artifacts — 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/e2e/autoscaling_test.go:102 — // TODO (alberto): have ability to label and get Nodes by NodePool. NodePool.Status.Nodes? — 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/e2e/autoscaling_test.go:192 — // TODO (alberto): have ability to label and get Nodes by NodePool. NodePool.Status.Nodes? — 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/e2e/autoscaling_test.go:119 — // TODO (alberto): check autoscalingEnabled condition. — 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/e2e/autoscaling_test.go:147 — // TODO (alberto): have ability for NodePool to label Nodes and let workload target specific Nodes. — 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/e2e/autoscaling_test.go:273 — // TODO (alberto): have ability for NodePool to label Nodes and let workload target specific Nodes. — 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/e2e/autoscaling_test.go:250 — // TODO (cewong): This should be reported in the HostedCluster as a condition — 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/e2e/chaos_test.go:623 — // TODO: Generics :-) — 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/e2e/control_plane_upgrade_test.go:85 — // TODO (cewong): enable this test once the fix for KAS->Kubelet communication has merged — 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/e2e/create_cluster_test.go:238 — // TODO(alberto): rename this e2e to drop TestCreateCluster prefix after merging https://github.com/openshift/release/pull/66655
  • TodoComment test/e2e/e2e_test.go:280 — // TODO(alberto): have a global t.Run which runs all tests first then TestAlertSLOs. — 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/e2e/e2e_test.go:285 — // TODO(GCP): Revisit. Prometheus support is WIP for GCP. — 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/e2e/karpenter_control_plane_upgrade_test.go:42 — // TODO(maxcao13): We disable consolidation as a hack to prevent flakiness in this blocking test. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/nodepool_rolling_upgrade_test.go:145 — // TODO(bclement): Revert this change once the root cause is found and fixed: — 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/e2e/olm_test.go:151 — // TODO: Rely on Operator Framework managed package once released — 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/e2e/v2/tests/backup_restore_test.go:297 — // TODO(mgencur): Remove this condition once https://redhat.atlassian.net/browse/MGMT-23509 is fixed
  • TodoComment test/e2e/v2/tests/control_plane_infrastructure_test.go:44 — // TODO: Remove these exemptions once the tracked issues are resolved. — 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/e2e/v2/tests/control_plane_upgrade_test.go:67 — // TODO: Implement post-upgrade assertions for autoscaled NodePools. — 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/e2e/v2/tests/control_plane_workloads_test.go:59 — // TODO: Figure out why Route kind does not exist when ingress-operator first starts — 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/e2e/util/util.go:122 — // TODO: Figure out why Route kind does not exist when ingress-operator first starts — 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.
  • + 235 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×72
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 47 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium CVE · ×66
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 41 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×49
  • Hotspot: REDACTED REDACTED:462 — REDACTED changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in HostedClusterReconciler.reconcile at line 462. 13 of those changes were fix/bug commits, and the other 22 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: hypershift-operator/controllers/hostedcluster/reconcile_legacy.go hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 336 in HostedClusterReconciler.reconcileLegacy at line 56. 5 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/hostedcluster/reconcile_legacy.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: control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:741 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in HostedControlPlaneReconciler.Reconcile at line 741. 13 of those changes were fix/bug commits, and the other 24 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.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: control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:361 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in reconciler.Reconcile at line 361. 6 of those changes were fix/bug commits, and the other 19 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.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: hypershift-operator/controllers/nodepool/nodepool_controller.go hypershift-operator/controllers/nodepool/nodepool_controller.go:313 — hypershift-operator/controllers/nodepool/nodepool_controller.go changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in NodePoolReconciler.reconcile at line 313. 9 of those changes were fix/bug commits, and the other 12 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/nodepool_controller.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: hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go:29 — hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in e2eutilallowlist.run at line 29. 1 of those changes was a fix/bug commit, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:444 — REDACTED changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in dump.DumpCluster at line 444. 6 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: hypershift-operator/controllers/nodepool/capi.go hypershift-operator/controllers/nodepool/capi.go:89 — hypershift-operator/controllers/nodepool/capi.go changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in CAPI.Reconcile at line 89. 6 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/capi.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: control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:69 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in kas.adaptDeployment at line 69. 3 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.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: hypershift-operator/main.go hypershift-operator/main.go:270 — hypershift-operator/main.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in main.run at line 270. 3 of those changes were fix/bug commits, and the other 5 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/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: cmd/install/install.go cmd/install/install.go:552 — cmd/install/install.go changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in install.InstallHyperShiftOperator at line 552. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/install/install.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: hypershift-operator/controllers/nodepool/conditions.go hypershift-operator/controllers/nodepool/conditions.go:783 — hypershift-operator/controllers/nodepool/conditions.go changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in NodePoolReconciler.setAllMachinesReadyCondition at line 783. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/conditions.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: control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:420 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in AWSEndpointServiceReconciler.Reconcile at line 420. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.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: cmd/cluster/aws/create.go cmd/cluster/aws/create.go:231 — cmd/cluster/aws/create.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in CreateOptions.ApplyPlatformSpecifics at line 231. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/cluster/aws/create.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: control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go:98 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in kas.generateConfig at line 98. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.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: cmd/cluster/gcp/create.go cmd/cluster/gcp/create.go:165 — cmd/cluster/gcp/create.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in RawCreateOptions.Validate at line 165. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/cluster/gcp/create.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: karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:96 — karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in KarpenterIgnitionReconciler.Reconcile at line 96. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- karpenter-operator/controllers/karpenterignition/karpenterignition_controller.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: karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:118 — karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in EC2NodeClassReconciler.Reconcile at line 118. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.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: hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go:633 — hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in testfuncstructure.reportGroup at line 633. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.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: cmd/cluster/core/create.go cmd/cluster/core/create.go:1104 — cmd/cluster/core/create.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in core.CreateCluster at line 1104. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/cluster/core/create.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: control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:184 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in GCPPrivateServiceConnectReconciler.Reconcile at line 184. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.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: hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:208 — hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in kubevirt.virtualMachineTemplateBase at line 208. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/kubevirt/kubevirt.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: karpenter-operator/main.go karpenter-operator/main.go:86 — karpenter-operator/main.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in main.run at line 86. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- karpenter-operator/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: cmd/cluster/azure/create.go cmd/cluster/azure/create.go:377 — cmd/cluster/azure/create.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in CreateOptions.ApplyPlatformSpecifics at line 377. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/cluster/azure/create.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: hypershift-operator/controllers/nodepool/token.go hypershift-operator/controllers/nodepool/token.go:243 — hypershift-operator/controllers/nodepool/token.go changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Token.cleanupOutdated at line 243. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/token.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.
  • + 24 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×40
  • FileTooLong: REDACTED REDACTED — FileTooLong — 3812 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: HostedClusterReconciler (73 blocks, 173-6427). The bar is 500 significant lines; this is 3312 over it, 7.62× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: hostedcontrolplane/hostedcontrolplane_controller.go control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go — FileTooLong — 2547 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: HostedControlPlaneReconciler (69 blocks, 179-3998). The bar is 500 significant lines; this is 2047 over it, 5.09× 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: resources/resources.go control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go — FileTooLong — 2204 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: reconciler (53 blocks, 139-3370). The bar is 500 significant lines; this is 1704 over it, 4.41× 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: assets/hypershift_operator.go cmd/install/assets/hypershift_operator.go — FileTooLong — 1624 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1124 over it, 3.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: repo_metrics/weekly_pr_report.py contrib/repo_metrics/weekly_pr_report.py — FileTooLong — 1468 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 968 over it, 2.94× 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: install/install.go cmd/install/install.go — FileTooLong — 1253 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 753 over it, 2.51× 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: hostedcluster/reconcile_legacy.go hypershift-operator/controllers/hostedcluster/reconcile_legacy.go — FileTooLong — 1139 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: HostedClusterReconciler (56-1844). The bar is 500 significant lines; this is 639 over it, 2.28× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: core/create.go cmd/cluster/core/create.go — FileTooLong — 962 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 462 over it, 1.92× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: nodepool/capi.go hypershift-operator/controllers/nodepool/capi.go — FileTooLong — 961 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: CAPI (24 blocks, 54-1582). The bar is 500 significant lines; this is 461 over it, 1.92× 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: nodepool/nodepool_controller.go hypershift-operator/controllers/nodepool/nodepool_controller.go — FileTooLong — 946 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: NodePoolReconciler (23 blocks, 112-1630). The bar is 500 significant lines; this is 446 over it, 1.89× 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: awsprivatelink/awsprivatelink_controller.go control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go — FileTooLong — 934 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 434 over it, 1.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: hypershift-operator/main.go hypershift-operator/main.go — FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 392 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 379 over it, 1.76× 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: powervs/create.go cmd/infra/powervs/create.go — FileTooLong — 857 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 357 over it, 1.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: nodepool/conditions.go hypershift-operator/controllers/nodepool/conditions.go — FileTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: NodePoolReconciler (23 blocks, 165-1305). The bar is 500 significant lines; this is 337 over it, 1.67× 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: REDACTED REDACTED — FileTooLong — 836 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: CertificateRevocationController (12 blocks, 66-1184). The bar is 500 significant lines; this is 336 over it, 1.67× 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: REDACTED REDACTED — FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 264 over it, 1.53× 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: gcpprivateserviceconnect/psc_endpoint_controller.go control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go — FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: GCPPrivateServiceConnectReconciler (21 blocks, 132-1255). The bar is 500 significant lines; this is 225 over it, 1.45× 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: hostedcluster/network_policies.go hypershift-operator/controllers/hostedcluster/network_policies.go — FileTooLong — 702 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 202 over it, 1.40× 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: etcdbackup/reconciler.go hypershift-operator/controllers/etcdbackup/reconciler.go — FileTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: HCPEtcdBackupReconciler (32 blocks, 94-1201). The bar is 500 significant lines; this is 187 over it, 1.37× 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: azureprivatelinkservice/controller.go control-plane-operator/controllers/azureprivatelinkservice/controller.go — FileTooLong — 675 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: AzurePrivateLinkServiceReconciler (27 blocks, 180-1267). The bar is 500 significant lines; this is 175 over it, 1.35× 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: REDACTED REDACTED — FileTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: IAMManager (49 blocks, 91-1178). The bar is 500 significant lines; this is 164 over it, 1.33× 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: REDACTED REDACTED — FileTooLong — 653 significant lines (blank, comment-only and punctuation-only lines excluded), about 63% of them inside a single declaration: DedicatedServingComponentSchedulerAndSizer (20 blocks, 332-975). The bar is 500 significant lines; this is 153 over it, 1.31× 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: aws/destroy.go cmd/infra/aws/destroy.go — FileTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: DestroyInfraOptions (20 blocks, 34-900). The bar is 500 significant lines; this is 138 over it, 1.28× 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: REDACTED REDACTED — FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: LocalIgnitionProvider (20 blocks, 58-1079). The bar is 500 significant lines; this is 109 over it, 1.22× 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×40
  • Duplicated block (8 lines × 2) cmd/oadp/backup.go:252 — cmd/oadp/backup.go:252-259 | cmd/oadp/schedule.go:244-252 — 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) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1073 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1073-1080 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:563-570 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1073` it does not close everything it opens, so those 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: `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1073` is reached only past a guard at line 1068 that tests `hcp.Namespace` and leaves the function early, and `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:563` reads `hcp.Namespace` 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 (8 lines × 2) control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:67 — control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:67-74 | control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:124-131 — both copies are in the same file, so extract the block into 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) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3131 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3131-3138 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3165-3172 — both copies are in the same file, so extract the block into 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) control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:207 — control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:207-214 | control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:288-295 — both copies are in the same file, so extract the 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 `control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:207` 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 (8 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1878 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1878-1885 | hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:320-327 — 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 `control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1878` 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. Check import visibility before settling on that home: `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (8 lines × 2) REDACTED:285 — REDACTED:285-292 | REDACTED:390-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:294` calls `collectStrippedSymbols` and `REDACTED:398` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:344 — hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:344-351 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:364-371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:344` it does not close everything it opens, so those exact lines 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) REDACTED:388 — REDACTED:388-395 | REDACTED:145-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:2106 — REDACTED:2106-2113 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1235-1242 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2106` 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 (8 lines × 2) REDACTED:2462 — REDACTED:2462-2469 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1477-1484 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2462` it does not close everything it opens, so those exact lines 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) REDACTED:2488 — REDACTED:2488-2495 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1503-1510 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2488` it does not close everything it opens, so those exact lines 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) REDACTED:2556 — REDACTED:2556-2563 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1631-1638 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2556` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:438 — hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:438-445 | hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:478-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 `hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:438` 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 (8 lines × 2) hypershift-operator/controllers/nodepool/nodepool_controller.go:442 — hypershift-operator/controllers/nodepool/nodepool_controller.go:442-449 | hypershift-operator/controllers/nodepool/secret_janitor.go:125-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) hypershift-operator/controllers/nodepool/nodepool_controller.go:913 — hypershift-operator/controllers/nodepool/nodepool_controller.go:913-920 | hypershift-operator/controllers/nodepool/nodepool_controller.go:940-948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) hypershift-operator/controllers/platform/azure/controller.go:290 — hypershift-operator/controllers/platform/azure/controller.go:290-297 | hypershift-operator/controllers/platform/azure/controller.go:533-540 — both copies are in the same file, so extract the block into 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) hypershift-operator/controllers/platform/azure/controller.go:363 — hypershift-operator/controllers/platform/azure/controller.go:363-370 | hypershift-operator/controllers/platform/azure/controller.go:563-570 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/platform/azure/controller.go:363` 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 (8 lines × 2) hypershift-operator/controllers/scheduler/aws/autoscaler.go:176 — hypershift-operator/controllers/scheduler/aws/autoscaler.go:176-183 | hypershift-operator/controllers/scheduler/aws/autoscaler.go:357-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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, `hypershift-operator/controllers/scheduler/aws/autoscaler.go:356` calls `Sort`, `machineSetsByName` and `hypershift-operator/controllers/scheduler/aws/autoscaler.go:175` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) hypershift-operator/main.go:1266 — hypershift-operator/main.go:1266-1273 | hypershift-operator/main.go:1334-1341 — both copies are in the same file, so extract the 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 `hypershift-operator/main.go:1266` it does not close everything it opens, so those exact lines 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) support/netutil/visibility.go:22 — support/netutil/visibility.go:22-29 | support/netutil/visibility.go:38-45 — both copies are in the same file, so extract the 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 `support/netutil/visibility.go:22` it does not close everything it opens, so those exact lines 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) support/upsert/upsert.go:80 — support/upsert/upsert.go:80-87 | support/upsert/upsert.go:102-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) cmd/cluster/none/destroy.go:43 — cmd/cluster/none/destroy.go:43-50 | cmd/cluster/openstack/destroy.go:50-57 — 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 (8 lines × 2) product-cli/cmd/cluster/cluster.go:34 — product-cli/cmd/cluster/cluster.go:34-41 | product-cli/cmd/nodepool/create.go:47-54 — 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 `product-cli/cmd/cluster/cluster.go:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/alerts/reconcile.go:41 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/alerts/reconcile.go:41-48 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/crd/reconcile.go:32-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. 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.
  • + 15 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×36
  • Duplicated block (9 lines × 2) cmd/cluster/agent/create.go:54 — cmd/cluster/agent/create.go:54-62 | cmd/cluster/kubevirt/create.go:81-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) cmd/cluster/aws/destroy.go:55 — cmd/cluster/aws/destroy.go:55-63 | product-cli/cmd/cluster/aws/destroy.go:45-53 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) cmd/infra/powervs/create.go:574 — cmd/infra/powervs/create.go:574-582 | cmd/infra/powervs/destroy.go:294-302 — 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 `cmd/infra/powervs/create.go:574` it does not close everything it opens, so those 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, `cmd/infra/powervs/destroy.go:303` calls `Info` and `cmd/infra/powervs/create.go:583` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:152 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:152-160 | control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:510-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:152` 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 (9 lines × 2) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1226 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1226-1234 | control-plane-operator/controllers/hostedcontrolplane/aws_ingress_dns.go:266-274 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1226` it does not close everything it opens, so those exact lines 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:38 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:38-46 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:74-82 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:38` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/configoperator/deployment.go:114 — control-plane-operator/controllers/hostedcontrolplane/v2/configoperator/deployment.go:114-122 | control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/deployment.go:49-57 — 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 (9 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:31 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:31-39 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:59-67 — both copies are in the same file, so extract the block into 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) control-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.go:108 — control-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.go:108-116 | control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:169-177 — 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 (9 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:116 — control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:116-124 | control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:154-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:591 — control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:591-599 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1340-1348 — 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 `control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:591` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) hypershift-operator/controllers/etcdbackup/reconciler.go:132 — hypershift-operator/controllers/etcdbackup/reconciler.go:132-140 | hypershift-operator/controllers/etcdbackup/reconciler.go:149-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:1805 — REDACTED:1805-1813 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1534-1542 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1805` it does not close everything it opens, so those exact lines 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) REDACTED:1960 — REDACTED:1960-1968 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1158-1166 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1960` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:108 — hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:108-116 | hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:125-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:285 — hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:285-293 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:321-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:285` it does not close everything it opens, so those exact lines 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) support/k8sutil/object.go:43 — support/k8sutil/object.go:43-51 | support/k8sutil/object.go:63-71 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/config.go:36 — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/config.go:36-44 | control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go:53-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) REDACTED:68 — REDACTED:68-76 | REDACTED:68-76 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1845 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1845-1853 | hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:293-301 — 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. Check import visibility before settling on that home: `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (9 lines × 2) pkg/capi/aws/exp/api/v1beta1/types.go:240 — pkg/capi/aws/exp/api/v1beta1/types.go:240-248 | pkg/capi/aws/exp/api/v1beta2/types.go:356-364 — `pkg/capi/aws/exp/api/v1beta1/types.go` and `pkg/capi/aws/exp/api/v1beta2/types.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 124 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 2) cmd/oadp/backup.go:143 — cmd/oadp/backup.go:143-151 | cmd/oadp/schedule.go:175-183 — 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 `cmd/oadp/backup.go:143` 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) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:895 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:895-903 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:931-939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:895` 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 (9 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:203 — control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:203-211 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go:54-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/controlplaneoperator/deployment.go:203` 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) support/awsutil/route53.go:237 — support/awsutil/route53.go:237-245 | support/awsutil/route53.go:268-276 — both copies are in the same file, so extract the 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 `support/awsutil/route53.go:237` 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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×33
  • Duplicated block (10 lines × 2) cmd/cluster/azure/destroy.go:136 — cmd/cluster/azure/destroy.go:136-145 | cmd/infra/azure/destroy.go:126-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) cmd/infra/aws/ec2.go:426 — cmd/infra/aws/ec2.go:426-435 | cmd/infra/aws/ec2.go:482-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) cmd/infra/azure/identities.go:43 — cmd/infra/azure/identities.go:43-52 | cmd/infra/azure/identities.go:346-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:556 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:556-565 | REDACTED:370-379 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:556` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:568` calls `IsZero` and `REDACTED:383` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1044 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1044-1053 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:536-545 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1044` it does not close everything it opens, so those exact lines 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) control-plane-operator/controllers/azureprivatelinkservice/controller.go:199 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:199-209 | hypershift-operator/controllers/platform/azure/controller.go:125-134 — 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 `control-plane-operator/controllers/azureprivatelinkservice/controller.go:199` 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, `control-plane-operator/controllers/azureprivatelinkservice/controller.go:196` calls `Watches`, `EnqueueRequestsFromMapFunc`, `mapHCPToAzurePLS` and `hypershift-operator/controllers/platform/azure/controller.go:124` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:94 — control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:94-103 | control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/component.go:61-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (10 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:54 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:54-63 | control-plane-operator/controllers/hostedcontrolplane/oauth/service.go:35-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:134 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:134-143 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:380-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/kas/service.go:134` 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) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:274 — control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:274-283 | control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go:171-180 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:274` 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) control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:40 — control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:40-49 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:383-392 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:33 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:33-42 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:90-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:33` 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) control-plane-operator/hostedclusterconfigoperator/controllers/node/setup.go:24 — control-plane-operator/hostedclusterconfigoperator/controllers/node/setup.go:24-33 | control-plane-operator/hostedclusterconfigoperator/controllers/spotremediation/setup.go:33-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/hostedclusterconfigoperator/controllers/node/setup.go:24` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) REDACTED:1267 — REDACTED:1267-1276 | hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:635-644 — 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 `REDACTED:1267` 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, `hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:645` calls `Slice` and `REDACTED:1277` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) REDACTED:2149 — REDACTED:2149-2158 | REDACTED:2237-2246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2149` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:99 — hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:99-108 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:103-112 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:99` 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) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:470 — hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:470-479 | hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:535-544 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:470` 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) hypershift-operator/controllers/scheduler/aws/autoscaler.go:149 — hypershift-operator/controllers/scheduler/aws/autoscaler.go:149-158 | REDACTED:102-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:199 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:199-208 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:220-229 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:199` 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) support/capi-crdmigrator/crd_migrator.go:303 — support/capi-crdmigrator/crd_migrator.go:303-312 | support/capi-crdmigrator/crd_migrator.go:326-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `support/capi-crdmigrator/crd_migrator.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 (10 lines × 2) cmd/infra/gcp/create_infra.go:63 — cmd/infra/gcp/create_infra.go:63-72 | cmd/infra/gcp/destroy_infra.go:35-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/gcp/create_infra.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.
  • Duplicated block (10 lines × 2) REDACTED:79 — REDACTED:79-88 | REDACTED:79-88 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) REDACTED:629 — REDACTED:629-638 | cmd/infra/gcp/networking.go:18-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 (10 lines × 2) pkg/capi/aws/api/v1beta1/awsidentity_types.go:181 — pkg/capi/aws/api/v1beta1/awsidentity_types.go:181-190 | pkg/capi/aws/api/v1beta2/awsidentity_types.go:184-193 — `pkg/capi/aws/api/v1beta1/awsidentity_types.go` and `pkg/capi/aws/api/v1beta2/awsidentity_types.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 2 separate duplicated blocks between them, totalling at least 169 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 2) pkg/capi/aws/api/v1beta2/groupversion_info.go:27 — pkg/capi/aws/api/v1beta2/groupversion_info.go:27-36 | pkg/capi/aws/exp/api/v1beta2/groupversion_info.go:27-36 — before extracting anything, compare `pkg/capi/aws/api/v1beta2/groupversion_info.go` and `pkg/capi/aws/exp/api/v1beta2/groupversion_info.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. 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.
  • + 8 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×33
  • Swallowed exception (caught, then discarded) support/upsert/apply.go:313 — `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) support/upsert/apply.go:317 — `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) support/releaseinfo/fake/fake.go:158 — `if err := client.Get(ctx, types.NamespacedName{Namespace: hc.Namespace, Name: hc.Spec.PullSecret.Name}, &pullSecret); 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) support/releaseinfo/fake/fake.go:166 — `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) support/reconcilerpolicy/pausereconcile.go:71 — `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) support/reconcilerpolicy/scoping.go:71 — `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) support/reconcilerpolicy/scoping.go:83 — `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) support/config/ownerref.go:29 — `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) support/conditions/gcp.go:10 — `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) support/backwardcompat/backwardcompat.go:69 — `if err := sigyaml.Unmarshal(manifest, &meta); 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) support/awsutil/route53.go:98 — `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) karpenter-operator/controllers/nodeclass/karpenter_util.go:203 — `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:85 — `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) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:389 — `if err := c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: CASecretName}, ca); 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) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:397 — `if err := c.Get(ctx, client.ObjectKey{Namespace: namespace, Name: ServingCertSecretName}, serving); 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:44 — `if err := r.List(ctx, hostedClusters); 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:356 — `if err := r.List(ctx, hostedClusters); 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:395 — `if err := r.List(ctx, otherReqServingNodes, client.MatchingLabels{pkgscheduler.OSDFleetManagerPairedNodesLabel: pairLabel}); 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) hypershift-operator/controllers/resourcebasedcpautoscaler/machine_sizes_cache.go:162 — `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) hypershift-operator/controllers/resourcebasedcpautoscaler/machine_sizes_cache.go:166 — `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) hypershift-operator/controllers/platform/azure/controller.go:844 — `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) hypershift-operator/controllers/nodepool/conditions.go:150 — `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) hypershift-operator/controllers/nodepool/nodepool_controller.go:1134 — `if err := r.List(ctx, nodePoolList, client.InNamespace(cm.Namespace)); 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) hypershift-operator/controllers/nodepool/nodepool_controller.go:1161 — `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) hypershift-operator/controllers/nodepool/nodepool_controller.go:1212 — `if err := r.List(ctx, nodePoolList, client.InNamespace(hc.Namespace)); 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.
  • + 8 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×28
  • Duplicated block (6 lines × 2) cmd/cluster/kubevirt/destroy.go:20 — cmd/cluster/kubevirt/destroy.go:20-25 | product-cli/cmd/cluster/kubevirt/destroy.go:19-24 — before extracting anything, compare `cmd/cluster/kubevirt/destroy.go` and `product-cli/cmd/cluster/kubevirt/destroy.go` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/kubevirt/destroy.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 (6 lines × 2) cmd/infra/azure/create_iam.go:56 — cmd/infra/azure/create_iam.go:56-61 | cmd/infra/azure/destroy_iam.go:44-49 — 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 `cmd/infra/azure/create_iam.go:56` it does not close everything it opens, so those exact lines 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) cmd/oadp/backup.go:127 — cmd/oadp/backup.go:127-132 | cmd/oadp/schedule.go:158-163 — 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 `cmd/oadp/backup.go:127` it does not close everything it opens, so those exact lines 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) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:258 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:258-263 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:291-296 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:258` it does not close everything it opens, so those exact lines 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) REDACTED:933 — REDACTED:933-938 | REDACTED:972-978 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:933` it does not close everything it opens, so those exact lines 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) REDACTED:5762 — REDACTED:5762-5768 | hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go:52-57 — 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) hypershift-operator/controllers/nodepool/secret_janitor.go:290 — hypershift-operator/controllers/nodepool/secret_janitor.go:290-295 | hypershift-operator/controllers/nodepool/secret_janitor.go:303-308 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/secret_janitor.go:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) REDACTED:330 — REDACTED:330-335 | hypershift-operator/controllers/platform/azure/controller.go:190-196 — 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 `REDACTED:330` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:335 — REDACTED:335-340 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:206-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:335` 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) hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:162 — hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:162-167 | hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:207-212 — both copies are in the same file, so extract the block into 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) ignition-server/controllers/tokensecret_controller.go:280 — ignition-server/controllers/tokensecret_controller.go:280-285 | ignition-server/controllers/tokensecret_controller.go:318-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `ignition-server/controllers/tokensecret_controller.go:280` 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) cmd/infra/gcp/create_iam.go:54 — cmd/infra/gcp/create_iam.go:54-59 | cmd/infra/gcp/destroy_iam.go:33-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/gcp/create_iam.go:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/podmonitor.go:12 — control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/podmonitor.go:12-17 | control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/podmonitor.go:12-17 — `control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/podmonitor.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/podmonitor.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 6 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (6 lines × 2) REDACTED:286 — REDACTED:286-291 | REDACTED:806-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:292` calls `Info` and `REDACTED:812` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:248 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:248-253 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/ibmcloud.go:159-164 — 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) hack/kubelet-ratcheting-gen/main.go:125 — hack/kubelet-ratcheting-gen/main.go:125-130 | hack/tools/docs-aggregator/main.go:25-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go:84 — pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go:84-89 | pkg/capi/openstack/api/v1beta2/openstackmachinetemplate_types.go:92-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) cmd/bastion/aws/create.go:54 — cmd/bastion/aws/create.go:54-59 | cmd/bastion/aws/destroy.go:40-46 — before extracting anything, compare `cmd/bastion/aws/create.go` and `cmd/bastion/aws/destroy.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) cmd/bastion/aws/destroy.go:105 — cmd/bastion/aws/destroy.go:105-111 | cmd/consolelogs/aws/getlogs.go:81-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/bastion/aws/destroy.go:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/bastion/aws/destroy.go:113` calls `Errorf` and `cmd/consolelogs/aws/getlogs.go:87` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) hypershift-operator/controllers/hostedcluster/etcd_recovery.go:87 — hypershift-operator/controllers/hostedcluster/etcd_recovery.go:87-92 | hypershift-operator/controllers/hostedcluster/etcd_recovery.go:105-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:401 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:401-406 | hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:649-654 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:401` it does not close everything it opens, so those exact lines 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) cmd/infra/azure/create.go:38 — cmd/infra/azure/create.go:38-43 | cmd/infra/azure/destroy.go:42-47 — 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 `cmd/infra/azure/create.go:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (6 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:41 — control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:41-46 | control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:48-53 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:66 — control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:66-71 | control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:92-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 `control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.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 (6 lines × 2) karpenter-operator/controllers/karpenter/karpenter_controller.go:223 — karpenter-operator/controllers/karpenter/karpenter_controller.go:223-228 | karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:101-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `karpenter-operator/controllers/karpenter/karpenter_controller.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. 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×27
  • Duplicated block (13 lines × 2) cmd/infra/aws/iam.go:1295 — cmd/infra/aws/iam.go:1295-1307 | cmd/infra/aws/iam.go:1326-1338 — both copies are in the same file, so extract the 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 `cmd/infra/aws/iam.go:1295` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) cmd/infra/aws/route53.go:345 — cmd/infra/aws/route53.go:345-357 | support/awsutil/route53.go:114-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/aws/route53.go:345` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) REDACTED:472 — REDACTED:472-484 | REDACTED:529-541 — both copies are in the same file, so extract the block into 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) cmd/infra/powervs/destroy.go:503 — cmd/infra/powervs/destroy.go:503-515 | cmd/infra/powervs/destroy.go:552-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/powervs/destroy.go:503` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:188 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:188-200 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:159-171 — 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 `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:188` it does not close everything it opens, so those exact lines 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:209 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:209-221 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:343-355 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:246 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:246-258 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:375-387 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:296 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:296-308 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:484-496 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:76 — control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:76-88 | control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:102-114 — both copies are in the same file, so extract the 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 `control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:76` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:209 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:209-221 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:237-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) REDACTED:622 — REDACTED:622-634 | REDACTED:1404-1416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:622` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/gcp_oidc.go:60 — hypershift-operator/controllers/hostedcluster/gcp_oidc.go:60-72 | REDACTED:5387-5399 — 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 `hypershift-operator/controllers/hostedcluster/gcp_oidc.go:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:3391 — REDACTED:3391-3403 | hypershift-operator/controllers/sharedingress/sharedingress_controller.go:364-376 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (13 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:133 — hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:133-145 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:134-146 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:559 — hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:559-571 | hypershift-operator/controllers/nodepool/kubevirt/network.go:110-122 — 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 `hypershift-operator/controllers/nodepool/kubevirt/network.go:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) hypershift-operator/controllers/nodepool/kubevirt.go:200 — hypershift-operator/controllers/nodepool/kubevirt.go:200-212 | hypershift-operator/controllers/nodepool/openstack.go:29-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/kubevirt.go:200` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:289 — REDACTED:289-301 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:168-180 — 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 `REDACTED:289` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:169 — hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:169-181 | hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:294-306 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:169` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:509 — karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:509-521 | karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:575-587 — both copies are in the same file, so extract the 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 (13 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:220 — pkg/capi/openstack/api/v1beta1/types.go:220-232 | pkg/capi/openstack/api/v1beta2/types.go:286-298 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (13 lines × 2) support/gcputil/gcputil.go:61 — support/gcputil/gcputil.go:61-73 | support/gcputil/gcputil.go:175-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `support/gcputil/gcputil.go:61` it does not close everything it opens, so those exact lines 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) support/upsert/apply.go:199 — support/upsert/apply.go:199-211 | support/upsert/upsert.go:144-156 — 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 `support/upsert/apply.go:199` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) support/netutil/visibility.go:107 — support/netutil/visibility.go:107-119 | support/netutil/visibility.go:143-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `support/netutil/visibility.go:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) REDACTED:126 — REDACTED:126-138 | REDACTED:126-138 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:657 — karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:657-669 | support/karpenter/karpenter.go:72-84 — 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×24
  • Duplicated block (11 lines × 2) cmd/bastion/aws/create.go:101 — cmd/bastion/aws/create.go:101-111 | cmd/bastion/aws/destroy.go:83-93 — before extracting anything, compare `cmd/bastion/aws/create.go` and `cmd/bastion/aws/destroy.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/bastion/aws/create.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/bastion/aws/create.go:113` calls `Errorf` and `cmd/bastion/aws/destroy.go:94` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) cmd/cluster/aws/destroy.go:21 — cmd/cluster/aws/destroy.go:21-31 | product-cli/cmd/cluster/aws/destroy.go:14-24 — 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) control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:276 — control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:276-286 | control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:298-308 — both copies are in the same file, so extract the 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 `control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) control-plane-operator/controllers/hostedcontrolplane/creatorupdate_ownerref_enforcer.go:17 — control-plane-operator/controllers/hostedcontrolplane/creatorupdate_ownerref_enforcer.go:17-27 | hypershift-operator/controllers/hostedcluster/createorupdate_annotation_enforcer.go:16-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/creatorupdate_ownerref_enforcer.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 (11 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2369 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2369-2379 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2441-2451 — both copies are in the same file, so extract the 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 `control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2369` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) REDACTED:755 — REDACTED:755-765 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:367-377 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:1358 — REDACTED:1358-1368 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:952-962 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) REDACTED:2276 — REDACTED:2276-2286 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1384-1394 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2276` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) REDACTED:2423 — REDACTED:2423-2433 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1434-1444 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2423` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:142 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:142-152 | hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:113-123 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:142` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1235 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1235-1245 | hypershift-operator/controllers/sharedingress/sharedingress_controller.go:168-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. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1235` 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) REDACTED:354 — REDACTED:354-364 | REDACTED:42-52 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:353` calls `Watches`, `EnqueueRequestsFromMapFunc` and `REDACTED:41` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) hypershift-operator/controllers/scheduler/aws/placeholders.go:106 — hypershift-operator/controllers/scheduler/aws/placeholders.go:106-116 | hypershift-operator/controllers/scheduler/aws/placeholders.go:119-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/scheduler/aws/placeholders.go:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) hypershift-operator/main.go:1232 — hypershift-operator/main.go:1232-1242 | hypershift-operator/main.go:1298-1308 — both copies are in the same file, so extract the 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 `hypershift-operator/main.go:1232` 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) support/awsutil/sts.go:28 — support/awsutil/sts.go:28-38 | support/awsutil/sts.go:49-59 — both copies are in the same file, so extract the 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 `support/awsutil/sts.go:28` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) REDACTED:149 — REDACTED:149-159 | REDACTED:189-199 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:149` 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 (11 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go:170 — control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go:170-180 | support/podspec/containers.go:247-257 — 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) hypershift-operator/main.go:1246 — hypershift-operator/main.go:1246-1256 | hypershift-operator/main.go:1311-1325 — both copies are in the same file, so extract the 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 `hypershift-operator/main.go:1246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) cmd/oadp/backup.go:156 — cmd/oadp/backup.go:156-166 | cmd/oadp/schedule.go:188-198 — 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 `cmd/oadp/backup.go:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:126 — control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:126-136 | control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:184-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:126` 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) cmd/install/assets/hypershift_operator.go:1709 — cmd/install/assets/hypershift_operator.go:1709-1719 | cmd/install/assets/hypershift_operator.go:1826-1836 — both copies are in the same file, so extract the 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 `cmd/install/assets/hypershift_operator.go:1709` it does not close everything it opens, so those exact lines 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) cmd/util/client.go:160 — cmd/util/client.go:160-170 | REDACTED:482-492 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/util/client.go:160` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) cmd/install/assets/hypershift_operator.go:697 — cmd/install/assets/hypershift_operator.go:697-707 | cmd/install/assets/hypershift_operator.go:711-721 — both copies are in the same file, so extract the 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 `cmd/install/assets/hypershift_operator.go:697` 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) cmd/cluster/kubevirt/create.go:304 — cmd/cluster/kubevirt/create.go:304-314 | REDACTED:258-268 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/kubevirt/create.go:304` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×22
  • Duplicated block (12 lines × 2) cmd/infra/aws/create_iam.go:265 — cmd/infra/aws/create_iam.go:265-276 | cmd/infra/aws/create_operator_roles.go:328-339 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) cmd/infra/azure/create_iam.go:49 — cmd/infra/azure/create_iam.go:49-60 | product-cli/cmd/iam/azure/create.go:36-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/azure/create_iam.go:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1243 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1243-1254 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:581-592 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:95 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:95-106 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:167-178 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/config.go:47 — control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/config.go:47-58 | control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/config.go:70-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/config.go:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.go:31 — control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.go:31-42 | control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/service.go:14-25 — `control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/service.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 12 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/service.go:31` it does not close everything it opens, so those exact lines 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) REDACTED:102 — REDACTED:102-113 | control-plane-operator/metrics-proxy/cmd.go:144-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2223 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2223-2234 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2243-2254 — both copies are in the same file, so extract the block into 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) REDACTED:350 — REDACTED:350-361 | REDACTED:551-562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:350` 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) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:244 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:244-255 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:418-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:244` 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) support/netutil/expose.go:80 — support/netutil/expose.go:80-91 | support/netutil/expose.go:100-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `support/netutil/expose.go:80` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:120 — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:120-131 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:99-110 — `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.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 41 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:95` calls `GetAuditPolicyConfig`, `RemoveContainer` and `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:117` 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) cmd/kubeconfig/create.go:57 — cmd/kubeconfig/create.go:57-68 | product-cli/cmd/kubeconfig/create.go:45-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/kubeconfig/create.go:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) REDACTED:4038 — REDACTED:4038-4049 | REDACTED:4090-4101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4038` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/nodepool/nto.go:304 — hypershift-operator/controllers/nodepool/nto.go:304-315 | hypershift-operator/controllers/nodepool/nto.go:329-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) cmd/infra/gcp/create_infra.go:84 — cmd/infra/gcp/create_infra.go:84-95 | cmd/infra/gcp/destroy_infra.go:56-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) REDACTED:629 — REDACTED:629-640 | REDACTED:699-710 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:96 — control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:96-115 | control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:131-142 — both copies are in the same file, so extract the 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 `control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) hypershift-operator/controllers/nodepool/capi.go:357 — hypershift-operator/controllers/nodepool/capi.go:357-368 | hypershift-operator/controllers/nodepool/capi.go:413-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:357` 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) cmd/oadp/backup.go:187 — cmd/oadp/backup.go:187-199 | cmd/oadp/schedule.go:214-225 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/oadp/backup.go:187` 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) cmd/cluster/aws/create.go:492 — cmd/cluster/aws/create.go:492-503 | cmd/cluster/gcp/create.go:428-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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/aws/create.go:492` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) cmd/oadp/backup.go:90 — cmd/oadp/backup.go:90-101 | cmd/oadp/schedule.go:121-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/oadp/backup.go:90` 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.
D3 · God Classes · MethodTooLong · ×20
  • MethodTooLong: HostedClusterReconciler.reconcileLegacy hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56 — MethodTooLong — reconcileLegacy runs 1095 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 995 over it, 10.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HostedClusterReconciler.reconcile REDACTED:462 — MethodTooLong — reconcile runs 730 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 630 over it, 7.30× 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: HyperShiftOperatorClusterRole.Build cmd/install/assets/hypershift_operator.go:1320 — MethodTooLong — Build runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HostedControlPlaneReconciler.setupKASClientSigners control-plane-operator/controllers/hostedcontrolplane/kas_pki_setup.go:19 — MethodTooLong — setupKASClientSigners runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HyperShiftOperatorDeployment.Build cmd/install/assets/hypershift_operator.go:588 — MethodTooLong — Build runs 145 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× 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: ExternalDNSDeployment.Build cmd/install/assets/hypershift_operator.go:276 — MethodTooLong — Build runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NodePoolReconciler.reconcile hypershift-operator/controllers/nodepool/nodepool_controller.go:313 — MethodTooLong — reconcile runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: reconciler.reconcileCloudCredentialSecrets control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1855 — MethodTooLong — reconcileCloudCredentialSecrets runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.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.
  • MethodTooLong: OpenStack.CAPIProviderDeploymentSpec hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:186 — MethodTooLong — CAPIProviderDeploymentSpec runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.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.
  • MethodTooLong: Azure.CAPIProviderDeploymentSpec hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:99 — MethodTooLong — CAPIProviderDeploymentSpec runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HostedClusterReconciler.delete REDACTED:4119 — MethodTooLong — delete runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: CAPI.Reconcile hypershift-operator/controllers/nodepool/capi.go:89 — MethodTooLong — Reconcile runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AWS.CAPIProviderDeploymentSpec hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:105 — MethodTooLong — CAPIProviderDeploymentSpec runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PowerVS.ReconcileCredentials hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:204 — MethodTooLong — ReconcileCredentials runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CreateOptions.ApplyPlatformSpecifics cmd/cluster/aws/create.go:231 — MethodTooLong — ApplyPlatformSpecifics runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CreateOptions.ApplyPlatformSpecifics cmd/cluster/azure/create.go:377 — MethodTooLong — ApplyPlatformSpecifics runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TokenSecretReconciler.Reconcile ignition-server/controllers/tokensecret_controller.go:183 — MethodTooLong — Reconcile runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HyperShiftMutatingWebhookConfiguration.Build cmd/install/assets/hypershift_operator.go:2181 — MethodTooLong — Build runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AzurePrivateLinkServiceController.reconcilePrivateLinkService hypershift-operator/controllers/platform/azure/controller.go:214 — MethodTooLong — reconcilePrivateLinkService runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: KarpenterOperatorOptions.adaptStandaloneDeployment control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go:104 — MethodTooLong — adaptStandaloneDeployment 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.
D3 · God Classes · ClassTooLong · ×19
  • ClassTooLong: HostedClusterReconciler REDACTED:173 — ClassTooLong — 2584 significant lines (blank, comment-only and punctuation-only lines excluded), 102 methods, 73 blocks, lines 173-6427. The bar is 400 significant lines; this is 2184 over it, 6.46× 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: HostedControlPlaneReconciler control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:179 — ClassTooLong — 2037 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods, 69 blocks, lines 179-3998. The bar is 400 significant lines; this is 1637 over it, 5.09× 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: reconciler control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:139 — ClassTooLong — 1833 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods, 53 blocks, lines 139-3370. The bar is 400 significant lines; this is 1433 over it, 4.58× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CAPI hypershift-operator/controllers/nodepool/capi.go:54 — ClassTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods, 24 blocks, lines 54-1582. The bar is 400 significant lines; this is 332 over it, 1.83× 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: HCPEtcdBackupReconciler hypershift-operator/controllers/etcdbackup/reconciler.go:94 — ClassTooLong — 625 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods, 32 blocks, lines 94-1201. The bar is 400 significant lines; this is 225 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NodePoolReconciler hypershift-operator/controllers/nodepool/nodepool_controller.go:112 — ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods, 23 blocks, lines 112-1630. The bar is 400 significant lines; this is 191 over it, 1.48× 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: AzurePrivateLinkServiceReconciler control-plane-operator/controllers/azureprivatelinkservice/controller.go:180 — ClassTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods, 27 blocks, lines 180-1267. The bar is 400 significant lines; this is 144 over it, 1.36× 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: CertificateRevocationController REDACTED:66 — ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods, 12 blocks, lines 66-1184. The bar is 400 significant lines; this is 132 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AWSEndpointServiceReconciler control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:235 — ClassTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods, 17 blocks, lines 235-1458. The bar is 400 significant lines; this is 131 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IAMManager REDACTED:91 — ClassTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods, 49 blocks, lines 91-1178. The bar is 400 significant lines; this is 126 over it, 1.32× 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: GCPPrivateServiceConnectReconciler control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:132 — ClassTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 21 blocks, lines 132-1255. The bar is 400 significant lines; this is 118 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DestroyInfraOptions cmd/infra/aws/destroy.go:34 — ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods, 20 blocks, lines 34-900. The bar is 400 significant lines; this is 105 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Infra cmd/infra/powervs/create.go:160 — ClassTooLong — 471 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods, 14 blocks, lines 160-1388. The bar is 400 significant lines; this is 71 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: LocalIgnitionProvider REDACTED:58 — ClassTooLong — 470 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, 20 blocks, lines 58-1079. The bar is 400 significant lines; this is 70 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DedicatedServingComponentSchedulerAndSizer REDACTED:332 — ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, 20 blocks, lines 332-975. The bar is 400 significant lines; this is 13 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DrOidcIamOptions REDACTED:84 — ClassTooLong — 412 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, 20 blocks, lines 84-946. The bar is 400 significant lines; this is 12 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AzurePrivateLinkServiceController hypershift-operator/controllers/platform/azure/controller.go:113 — ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods, 13 blocks, lines 113-864. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Reconciler control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:72 — ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods, 21 blocks, lines 72-716. The bar is 400 significant lines; this is 7 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AWSEndpointServiceReconciler REDACTED:67 — ClassTooLong — 405 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods, 18 blocks, lines 67-893. The bar is 400 significant lines; this is 5 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×19
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/deployment.go:21 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/deployment.go:21-27 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/kubevirt/deployment.go:37-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/deployment.go:21` it does not close everything it opens, so those exact lines 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) control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/webhookvalidation.go:38 — control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/webhookvalidation.go:38-44 | control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/webhookvalidation.go:59-65 — both copies are in the same file, so extract the 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 `control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/webhookvalidation.go:38` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) REDACTED:337 — REDACTED:337-343 | REDACTED:537-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:337` 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) hypershift-operator/controllers/nodepool/conditions.go:402 — hypershift-operator/controllers/nodepool/conditions.go:402-408 | hypershift-operator/controllers/nodepool/conditions.go:431-437 — both copies are in the same file, so extract the block into 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) hypershift-operator/controllers/nodepool/conditions.go:402 — hypershift-operator/controllers/nodepool/conditions.go:402-408 | hypershift-operator/controllers/nodepool/nto.go:509-515 — 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) hypershift-operator/controllers/scheduler/aws/autoscaler.go:66 — hypershift-operator/controllers/scheduler/aws/autoscaler.go:66-72 | REDACTED:35-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) ignition-payload-controller/main.go:59 — ignition-payload-controller/main.go:59-65 | sharedingress-config-generator/main.go:34-40 — 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 `ignition-payload-controller/main.go:59` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) cmd/cluster/core/destroy.go:438 — cmd/cluster/core/destroy.go:438-444 | cmd/cluster/core/destroy.go:477-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) cmd/infra/azure/create.go:97 — cmd/infra/azure/create.go:97-103 | cmd/infra/azure/destroy.go:84-90 — 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) cmd/oadp/backup.go:53 — cmd/oadp/backup.go:53-59 | cmd/oadp/schedule.go:68-74 — 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 `cmd/oadp/backup.go:53` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/sessionsecrets.go:82 — control-plane-operator/controllers/hostedcontrolplane/v2/oauth/sessionsecrets.go:82-88 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/oauth/reconcile.go:90-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/sessionsecrets.go:90 — control-plane-operator/controllers/hostedcontrolplane/v2/oauth/sessionsecrets.go:90-96 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/oauth/reconcile.go:98-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/router/config.go:34 — control-plane-operator/controllers/hostedcontrolplane/v2/router/config.go:34-40 | sharedingress-config-generator/config.go:38-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/azureprivatelinkservice/controller.go:395 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:395-401 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:475-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/azureprivatelinkservice/controller.go:395` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) hypershift-operator/controllers/nodepool/capi.go:1556 — hypershift-operator/controllers/nodepool/capi.go:1556-1562 | hypershift-operator/controllers/nodepool/capi.go:1566-1573 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/capi.go:1556` 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 (7 lines × 2) support/releaseinfo/releaseinfo.go:246 — support/releaseinfo/releaseinfo.go:246-252 | support/releaseinfo/releaseinfo.go:269-275 — both copies are in the same file, so extract the 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 `support/releaseinfo/releaseinfo.go:246` it does not close everything it opens, so those exact lines 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) REDACTED:3825 — REDACTED:3825-3831 | REDACTED:3833-3839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3825` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:28 — control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:28-34 | control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.go:55-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:28` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:116 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:116-122 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:135-141 — both copies are in the same file, so extract the 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 `control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:116` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×17
  • Duplicated block (5 lines × 2) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2672 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2672-2676 | control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:177-183 — 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 `control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2672` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) hypershift-operator/controllers/nodepool/conditions.go:1192 — hypershift-operator/controllers/nodepool/conditions.go:1192-1196 | hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:437-442 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:163 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:163-167 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:464-468 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:176 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:176-180 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:477-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/webhookcerts/webhookcerts_controller.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 (5 lines × 2) karpenter-operator/controllers/karpenter/karpenter_controller.go:189 — karpenter-operator/controllers/karpenter/karpenter_controller.go:189-193 | karpenter-operator/controllers/karpenter/karpenter_controller.go:199-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `karpenter-operator/controllers/karpenter/karpenter_controller.go:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) cmd/cluster/none/destroy.go:54 — cmd/cluster/none/destroy.go:54-58 | cmd/cluster/openstack/destroy.go:61-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) cmd/oadp/common.go:171 — cmd/oadp/common.go:171-175 | cmd/oadp/restore.go:102-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) REDACTED:3832 — REDACTED:3832-3836 | REDACTED:3840-3844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3832` it does not close everything it opens, so those 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) hypershift-operator/controllers/nodepool/nodepool_controller.go:596 — hypershift-operator/controllers/nodepool/nodepool_controller.go:596-600 | hypershift-operator/controllers/nodepool/nodepool_controller.go:607-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/nodepool_controller.go:596` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:319 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:319-323 | hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:336-340 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:319` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:79 — hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:79-83 | hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:123-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:79` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) REDACTED:2454 — REDACTED:2454-2458 | REDACTED:2477-2481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2454` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2482` calls `ensureHostedResourcesAreEmpty`, `Errorf` and `REDACTED:2459` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) cmd/infra/powervs/create.go:231 — cmd/infra/powervs/create.go:231-235 | cmd/infra/powervs/destroy.go:121-125 — 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 `cmd/infra/powervs/create.go:231` it does not close everything it opens, so those exact lines 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) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1469 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1469-1473 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1492-1496 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1469` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1497` calls `ensureHostedResourcesAreEmpty`, `Errorf` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1474` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:23 — control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:23-27 | control-plane-operator/controllers/hostedcontrolplane/v2/routecm/config.go:23-27 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:23` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) hypershift-operator/controllers/nodepool/nodepool_controller.go:434 — hypershift-operator/controllers/nodepool/nodepool_controller.go:434-438 | hypershift-operator/controllers/nodepool/secret_janitor.go:118-122 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/nodepool_controller.go:434` it does not close everything it opens, so those exact lines 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) REDACTED:2129 — REDACTED:2129-2133 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1249-1253 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×13
  • Duplicated block (16 lines × 2) cmd/install/assets/hypershift_operator.go:1247 — cmd/install/assets/hypershift_operator.go:1247-1262 | cmd/install/assets/hypershift_operator.go:1687-1702 — both copies are in the same file, so extract the 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 `cmd/install/assets/hypershift_operator.go:1247` 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 (16 lines × 2) control-plane-operator/controllers/azureprivatelinkservice/controller.go:248 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:248-263 | hypershift-operator/controllers/platform/azure/controller.go:140-155 — 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 `control-plane-operator/controllers/azureprivatelinkservice/controller.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 (16 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:49 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:49-64 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:85-100 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also 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) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:127 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:127-142 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:157-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (16 lines × 2) control-plane-operator/hostedclusterconfigoperator/cmd.go:285 — control-plane-operator/hostedclusterconfigoperator/cmd.go:285-300 | karpenter-operator/main.go:204-219 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go:130 — control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go:130-145 | control-plane-operator/hostedclusterconfigoperator/controllers/spotremediation/spotremediation.go:105-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:57 — hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:57-72 | hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:58-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) REDACTED:1297 — REDACTED:1297-1312 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:901-916 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1297` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/ibmcloud/ibmcloud.go:42 — hypershift-operator/controllers/hostedcluster/internal/platform/ibmcloud/ibmcloud.go:42-57 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:60-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (16 lines × 2) hypershift-operator/controllers/nodepool/secret_janitor.go:179 — hypershift-operator/controllers/nodepool/secret_janitor.go:179-194 | hypershift-operator/controllers/nodepool/secret_janitor.go:201-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/secret_janitor.go:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) karpenter-operator/controllers/karpenter/karpenter_controller.go:388 — karpenter-operator/controllers/karpenter/karpenter_controller.go:388-403 | karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:246-261 — 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 `karpenter-operator/controllers/karpenter/karpenter_controller.go:388` 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) konnectivity-socks5-proxy/http_proxy.go:83 — konnectivity-socks5-proxy/http_proxy.go:83-98 | support/konnectivityproxy/proxy_dialer.go:73-88 — before extracting anything, compare `konnectivity-socks5-proxy/http_proxy.go` and `support/konnectivityproxy/proxy_dialer.go` as WHOLE FILES: 90% 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 (16 lines × 2) hypershift-operator/controllers/hostedcluster/network_policies.go:1027 — hypershift-operator/controllers/hostedcluster/network_policies.go:1027-1042 | hypershift-operator/controllers/hostedcluster/network_policies.go:1054-1070 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/hostedcluster/network_policies.go:1027` 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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×13
  • Duplicated block (14 lines × 2) cmd/infra/gcp/networking.go:332 — cmd/infra/gcp/networking.go:332-345 | cmd/infra/gcp/networking.go:352-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/gcp/networking.go:332` 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) contrib/gomaxprocs-webhook/internal/config/types.go:56 — contrib/gomaxprocs-webhook/internal/config/types.go:56-69 | contrib/gomaxprocs-webhook/internal/config/types.go:76-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1108 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1108-1121 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:545-558 — 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 `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1108` 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, `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1107` calls `Sprintf` and `hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:544` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:502 — control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:502-515 | control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:83-96 — 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 `control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:502` 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) REDACTED:452 — REDACTED:452-465 | REDACTED:522-535 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:452` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go:31 — control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go:31-44 | control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/component.go:57-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/component.go:31` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:218 — control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:218-231 | control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go:93-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:142 — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:142-155 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:121-134 — `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.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 41 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) REDACTED:1888 — REDACTED:1888-1901 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1715-1728 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1884` calls `New`, `ComponentImages` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1713` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) REDACTED:2589 — REDACTED:2589-2602 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1660-1673 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2589` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) REDACTED:3886 — REDACTED:3886-3899 | REDACTED:6237-6250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3886` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) support/netutil/visibility.go:127 — support/netutil/visibility.go:127-140 | support/netutil/visibility.go:163-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) cmd/install/assets/hypershift_operator.go:1921 — cmd/install/assets/hypershift_operator.go:1921-1934 | cmd/install/assets/hypershift_operator.go:1941-1954 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×12
  • Edited copy of a member (15 corresponding lines) REDACTED:202 — REDACTED:202-216 | REDACTED:254-274 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1753 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1753-1767 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1769-1783 — 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) cmd/bastion/aws/create.go:100 — cmd/bastion/aws/create.go:100-117 | cmd/bastion/aws/destroy.go:82-96 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:17 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:17-34 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/gcp/component.go:60-74 — 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) hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:445 — hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:445-459 | hypershift-operator/controllers/hostedcluster/karpenter.go:151-165 — 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) support/releaseinfo/releaseinfo.go:330 — support/releaseinfo/releaseinfo.go:330-344 | support/releaseinfo/releaseinfo.go:348-365 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/nto/deployment.go:11 — control-plane-operator/controllers/hostedcontrolplane/v2/nto/deployment.go:11-25 | control-plane-operator/controllers/hostedcontrolplane/v2/pkioperator/deployment.go:12-27 — 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) cmd/cluster/gcp/create.go:424 — cmd/cluster/gcp/create.go:424-439 | cmd/cluster/kubevirt/create.go:285-299 — 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) cmd/destroy/destroy.go:12 — cmd/destroy/destroy.go:12-26 | product-cli/cmd/destroy/destroy.go:14-28 — 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) REDACTED:981 — REDACTED:981-995 | cmd/install/install.go:1156-1172 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/component.go:32 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/component.go:32-46 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/gcp/component.go:37-54 — 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) hypershift-operator/controllers/hostedcluster/metrics/metrics.go:221 — hypershift-operator/controllers/hostedcluster/metrics/metrics.go:221-235 | hypershift-operator/controllers/nodepool/metrics/metrics.go:180-194 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×12
  • Edited copy of a member (10 corresponding lines) hypershift-operator/controllers/nodepool/nodepool_controller.go:1326 — hypershift-operator/controllers/nodepool/nodepool_controller.go:1326-1335 | hypershift-operator/controllers/nodepool/nodepool_controller.go:1342-1351 — 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) REDACTED:218 — REDACTED:218-227 | REDACTED:276-289 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/storage/azure.go:55 — control-plane-operator/controllers/hostedcontrolplane/v2/storage/azure.go:55-64 | control-plane-operator/controllers/hostedcontrolplane/v2/storage/azure.go:72-81 — 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) cmd/infra/gcp/networking.go:368 — cmd/infra/gcp/networking.go:368-377 | control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:199-208 — 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) hypershift-operator/controllers/ignitionpayload/controller.go:445 — hypershift-operator/controllers/ignitionpayload/controller.go:445-454 | hypershift-operator/controllers/ignitionpayload/controller.go:457-466 — 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) support/awsutil/sg.go:202 — support/awsutil/sg.go:202-211 | support/awsutil/sg.go:213-222 — 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) REDACTED:679 — REDACTED:679-688 | REDACTED:692-703 — 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) cmd/infra/aws/create_cli_role.go:250 — cmd/infra/aws/create_cli_role.go:250-259 | support/awsutil/sg.go:264-276 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:40 — control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:40-49 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenter/component.go:40-50 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/oauth/reconcile.go:61 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/oauth/reconcile.go:61-71 | REDACTED:3527-3536 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/component.go:32 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/component.go:32-45 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/powervs/component.go:32-41 — 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) pkg/capi/agent/v1beta1/groupversion_info.go:27 — pkg/capi/agent/v1beta1/groupversion_info.go:27-36 | pkg/capi/gcp/api/v1beta1/groupversion_info.go:27-36 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×11
  • Edited copy of a member (11 corresponding lines) support/podspec/deployment.go:15 — support/podspec/deployment.go:15-26 | support/podspec/deployment.go:28-38 — 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) REDACTED:204 — REDACTED:204-214 | REDACTED:335-347 — 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) cmd/util/client.go:204 — cmd/util/client.go:204-214 | cmd/util/params.go:100-116 — 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) hypershift-operator/controllers/nodepool/token.go:180 — hypershift-operator/controllers/nodepool/token.go:180-193 | ignition-payload-controller/main.go:191-201 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:396 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:396-406 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:408-419 — 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) pkg/capi/aws/api/v1beta1/network_types.go:359 — pkg/capi/aws/api/v1beta1/network_types.go:359-369 | pkg/capi/aws/api/v1beta2/network_types.go:863-873 — 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) cmd/infra/azure/destroy_iam.go:151 — cmd/infra/azure/destroy_iam.go:151-165 | REDACTED:667-677 — 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) control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:92 — control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:92-103 | control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/component.go:60-70 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:320 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:320-330 | control-plane-operator/controllers/hostedcontrolplane/oauth/route.go:17-28 — 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) REDACTED:252 — REDACTED:252-264 | cmd/util/client.go:174-184 — 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) support/azureutil/azureutil.go:351 — support/azureutil/azureutil.go:351-364 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:361-371 — 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.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×10
  • Edited copy of a member (19 corresponding lines) support/netutil/visibility.go:106 — support/netutil/visibility.go:106-124 | support/netutil/visibility.go:142-160 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:255 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:255-273 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:288-317 — 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) REDACTED:4036 — REDACTED:4036-4054 | REDACTED:4088-4106 — 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) support/k8sutil/object.go:42 — support/k8sutil/object.go:42-60 | support/k8sutil/object.go:62-83 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) cmd/create/create.go:15 — cmd/create/create.go:15-35 | product-cli/cmd/create/create.go:16-34 — 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) REDACTED:84 — REDACTED:84-102 | REDACTED:166-186 — 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) hack/tools/crd-schema-check/main.go:303 — hack/tools/crd-schema-check/main.go:303-321 | hack/tools/verify-api-deps/main.go:335-358 — 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) support/netutil/expose.go:73 — support/netutil/expose.go:73-91 | support/netutil/expose.go:93-111 — 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) pkg/capi/aws/api/v1beta1/tags.go:233 — pkg/capi/aws/api/v1beta1/tags.go:233-251 | pkg/capi/aws/api/v1beta2/tags.go:244-264 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/oapi/reconcile.go:37 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/oapi/reconcile.go:37-55 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/olm/packageserver.go:34-52 — 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 (20 corresponding lines) · ×10
  • Edited copy of a member (20 corresponding lines) cmd/cluster/core/destroy.go:433 — cmd/cluster/core/destroy.go:433-452 | cmd/cluster/core/destroy.go:472-502 — 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) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1029 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:1029-1048 | hypershift-operator/controllers/platform/azure/controller.go:735-758 — 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) support/awsutil/sts.go:18 — support/awsutil/sts.go:18-38 | support/awsutil/sts.go:40-59 — 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) support/azureutil/azureutil.go:116 — support/azureutil/azureutil.go:116-135 | support/azureutil/azureutil.go:139-158 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:679 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:679-701 | support/config/deployment.go:14-33 — 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) control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:271 — control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:271-291 | control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:294-313 — 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) cmd/cluster/none/destroy.go:60 — cmd/cluster/none/destroy.go:60-79 | cmd/cluster/openstack/destroy.go:67-86 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:27 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:27-46 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:61-82 — 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) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:386 — hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:386-405 | hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:407-428 — 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) control-plane-operator/controllers/hostedcontrolplane/pki/ca.go:195 — control-plane-operator/controllers/hostedcontrolplane/pki/ca.go:195-217 | control-plane-operator/controllers/hostedcontrolplane/pki/ca.go:244-263 — 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 (12 corresponding lines) · ×10
  • Edited copy of a member (12 corresponding lines) hypershift-operator/controllers/scheduler/aws/autoscaler.go:65 — hypershift-operator/controllers/scheduler/aws/autoscaler.go:65-77 | hypershift-operator/controllers/scheduler/aws/autoscaler.go:126-137 — 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) hypershift-operator/controllers/hostedcluster/metrics/metrics.go:196 — hypershift-operator/controllers/hostedcluster/metrics/metrics.go:196-207 | hypershift-operator/controllers/nodepool/metrics/metrics.go:141-156 — 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) control-plane-operator/controllers/hostedcontrolplane/pki/etcd.go:32 — control-plane-operator/controllers/hostedcontrolplane/pki/etcd.go:32-43 | control-plane-operator/controllers/hostedcontrolplane/pki/etcd.go:57-70 — 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) hypershift-operator/controllers/etcdbackup/reconciler.go:131 — hypershift-operator/controllers/etcdbackup/reconciler.go:131-142 | hypershift-operator/controllers/etcdbackup/reconciler.go:148-159 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:3936 — REDACTED:3936-3950 | hypershift-operator/controllers/nodepool/nodepool_controller.go:757-768 — 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) cmd/infra/aws/ec2.go:113 — cmd/infra/aws/ec2.go:113-124 | cmd/infra/aws/ec2.go:297-308 — 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) cmd/oadp/common.go:67 — cmd/oadp/common.go:67-80 | cmd/oadp/common.go:86-97 — 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) product-cli/cmd/nodepool/agent/create.go:11 — product-cli/cmd/nodepool/agent/create.go:11-24 | cmd/nodepool/agent/create.go:37-48 — 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) control-plane-operator/controllers/hostedcontrolplane/manifests/kas.go:64 — control-plane-operator/controllers/hostedcontrolplane/manifests/kas.go:64-75 | pkg/manifests/cpo/kas.go:31-42 — 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) pkg/capi/azure/api/v1beta1/groupversion_info.go:27 — pkg/capi/azure/api/v1beta1/groupversion_info.go:27-38 | pkg/capi/ibmcloud/api/v1beta2/groupversion_info.go:28-39 — 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.
D3 · God Classes · TooManyMethods · ×9
  • TooManyMethods: HostedClusterReconciler REDACTED:173 — TooManyMethods — 102 methods, declared across 8 files: REDACTED (73), hostedcluster/etcd_recovery.go (11), hostedcluster/network_policies.go (10), hostedcluster/karpenter.go (3), +4 more file(s). The bar is 30 methods; this is 72 over it, 3.40× 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: HostedControlPlaneReconciler control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:179 — TooManyMethods — 77 methods, declared across 3 files: hostedcontrolplane/hostedcontrolplane_controller.go (68), hostedcontrolplane/aws_ingress_dns.go (8), hostedcontrolplane/kas_pki_setup.go (1). The bar is 30 methods; this is 47 over it, 2.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NodePoolReconciler hypershift-operator/controllers/nodepool/nodepool_controller.go:112 — TooManyMethods — 66 methods, declared across 11 files: nodepool/conditions.go (23), nodepool/nodepool_controller.go (22), nodepool/nto.go (5), nodepool/kubevirt.go (3), +7 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: reconciler control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:139 — TooManyMethods — 53 methods, declared across 2 files: resources/resources.go (52), resources/gcp_lb_service_annotations.go (1). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: IAMManager REDACTED:91 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CreateInfraOptions cmd/infra/aws/create.go:34 — TooManyMethods — 42 methods, declared across 3 files: aws/ec2.go (26), aws/create.go (14), aws/route53.go (2). The bar is 30 methods; this is 12 over it, 1.40× 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: PRReportGenerator contrib/repo_metrics/weekly_pr_report.py:388 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HCPEtcdBackupReconciler hypershift-operator/controllers/etcdbackup/reconciler.go:94 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CAPI hypershift-operator/controllers/nodepool/capi.go:54 — TooManyMethods — 31 methods, declared across 8 files: nodepool/capi.go (23), nodepool/aws.go (2), nodepool/agent.go (1), nodepool/azure.go (1), +4 more file(s). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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.
D3 · God Classes · TooManyFields · ×9
  • TooManyFields: Options cmd/install/install.go:89 — TooManyFields — 85 stored fields beside 14 methods. The bar is 30 stored fields; this is 55 over it, 2.83× 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: RawCreateOptions cmd/cluster/core/create.go:190 — TooManyFields — 63 stored fields beside 7 methods. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: HyperShiftOperatorDeployment cmd/install/assets/hypershift_operator.go:532 — TooManyFields — 53 stored fields beside 10 methods. The bar is 30 stored fields; this is 23 over it, 1.77× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: Instance pkg/capi/aws/api/v1beta2/types.go:166 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AWSMachineSpec pkg/capi/aws/api/v1beta2/awsmachine_types.go:79 — TooManyFields — 36 stored fields. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: HostedControlPlaneSpec api/hypershift/v1beta1/hosted_controlplane.go:45 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× 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: HostedClusterSpec api/hypershift/v1beta1/hostedcluster_types.go:578 — TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: AzureManagedControlPlaneClassSpec pkg/capi/azure/api/v1beta1/types_class.go:83 — TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: RawCreateOptions cmd/cluster/aws/create.go:36 — TooManyFields — 31 stored fields beside 1 method. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×9
  • Edited copy of a member (23 corresponding lines) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:396 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:396-418 | hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:644-669 — 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) cmd/cluster/core/destroy.go:285 — cmd/cluster/core/destroy.go:285-307 | cmd/cluster/core/destroy.go:309-332 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go:129 — control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go:129-151 | control-plane-operator/hostedclusterconfigoperator/controllers/spotremediation/spotremediation.go:104-126 — 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) cmd/cluster/cluster.go:21 — cmd/cluster/cluster.go:21-45 | product-cli/cmd/cluster/cluster.go:19-41 — 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) hypershift-operator/controllers/nodepool/capi.go:1445 — hypershift-operator/controllers/nodepool/capi.go:1445-1468 | support/netutil/route.go:52-74 — 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) cmd/cluster/core/create.go:1279 — cmd/cluster/core/create.go:1279-1303 | cmd/cluster/core/create.go:1305-1327 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:180 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:180-206 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:318-340 — 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:1081 — REDACTED:1081-1103 | REDACTED:1403-1427 — 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:470 — REDACTED:470-492 | REDACTED:526-549 — 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) · ×9
  • Edited copy of a member (18 corresponding lines) hypershift-operator/controllers/ignitionpayload/controller.go:486 — hypershift-operator/controllers/ignitionpayload/controller.go:486-503 | hypershift-operator/controllers/nodepool/config.go:575-594 — 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) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:63 — hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:63-80 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:84-101 — 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) hypershift-operator/metrics.go:36 — hypershift-operator/metrics.go:36-55 | karpenter-operator/metrics.go:30-47 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:3372 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:3372-3389 | hypershift-operator/controllers/nodepool/kubevirt/network.go:88-105 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_credential_operator/component.go:36 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_credential_operator/component.go:36-54 | control-plane-operator/controllers/hostedcontrolplane/v2/dnsoperator/component.go:35-52 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/ocm/component.go:33 — control-plane-operator/controllers/hostedcontrolplane/v2/ocm/component.go:33-51 | control-plane-operator/controllers/hostedcontrolplane/v2/routecm/component.go:35-52 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/kcm/component.go:17 — control-plane-operator/controllers/hostedcontrolplane/v2/kcm/component.go:17-38 | control-plane-operator/controllers/hostedcontrolplane/v2/kube_scheduler/component.go:32-49 — 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) cmd/infra/aws/route53.go:319 — cmd/infra/aws/route53.go:319-342 | support/awsutil/route53.go:143-160 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:247 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:247-264 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/admissionpolicies.go:103-120 — 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 · Duplicated block (15 lines × 2) · ×9
  • Duplicated block (15 lines × 2) REDACTED:429 — REDACTED:429-443 | REDACTED:1126-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 `REDACTED:429` it does not close everything it opens, so those exact lines 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) control-plane-operator/controllers/azureprivatelinkservice/observer.go:108 — control-plane-operator/controllers/azureprivatelinkservice/observer.go:108-122 | control-plane-operator/controllers/gcpprivateserviceconnect/observer.go:91-105 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `control-plane-operator/controllers/gcpprivateserviceconnect/observer.go:91` is reached only past a guard at line 63 that tests `r.ServiceName` and leaves the function early, and `control-plane-operator/controllers/azureprivatelinkservice/observer.go:108` reads `r.ServiceName` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
  • Duplicated block (15 lines × 2) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3926 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3926-3940 | REDACTED:6046-6060 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (15 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:521 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:521-535 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:611-625 — both copies are in the same file, so extract the 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 `control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:521` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) etcd-defrag/main.go:44 — etcd-defrag/main.go:44-58 | kas-bootstrap/main.go:33-47 — `etcd-defrag/main.go` and `kas-bootstrap/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `etcd-defrag/main.go:44` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:66 — hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:66-80 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:87-101 — both copies are in the same file, so extract the 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 `hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131-145 | hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:115-129 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131` 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, `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:128` calls `Sprintf`, `Join` and `hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:112` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) REDACTED:71 — REDACTED:71-85 | product-cli/main.go:64-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:71` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) support/imageregistry/imagemetadata.go:350 — support/imageregistry/imagemetadata.go:350-364 | REDACTED:249-263 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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.
D3 · God Classes · FunctionTooLong · ×8
  • FunctionTooLong: main.NewStartCommand control-plane-operator/main.go:323 — FunctionTooLong — NewStartCommand runs 190 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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: kas.generateConfig control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go:98 — FunctionTooLong — generateConfig runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: certrotationcontroller.NewCertRotationController control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:37 — FunctionTooLong — NewCertRotationController runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: resources.Setup control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:183 — FunctionTooLong — Setup runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: konnectivityhttpsproxy.NewStartCommand REDACTED:31 — FunctionTooLong — NewStartCommand runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: install.setupAuth cmd/install/install.go:1713 — FunctionTooLong — setupAuth runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: kas.NewComponent control-plane-operator/controllers/hostedcontrolplane/v2/kas/component.go:50 — FunctionTooLong — NewComponent runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: main.RunOperator control-plane-pki-operator/operator.go:28 — FunctionTooLong — RunOperator 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 (14 corresponding lines) · ×8
  • Edited copy of a member (14 corresponding lines) REDACTED:1846 — REDACTED:1846-1859 | REDACTED:1928-1945 — 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) support/netutil/visibility.go:21 — support/netutil/visibility.go:21-34 | support/netutil/visibility.go:37-50 — 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) hypershift-operator/controllers/nodepool/nto.go:158 — hypershift-operator/controllers/nodepool/nto.go:158-176 | hypershift-operator/controllers/nodepool/nto.go:200-213 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2780 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2780-2793 | hypershift-operator/controllers/nodepool/nto.go:215-228 — 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) control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:281 — control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:281-294 | control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:298-311 — 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) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:351 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:351-364 | karpenter-operator/controllers/karpenter/machine_approver.go:252-265 — 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) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:558 — hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:558-571 | hypershift-operator/controllers/nodepool/kubevirt/network.go:108-122 — 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) support/config/cipher.go:39 — support/config/cipher.go:39-52 | support/config/cipher.go:70-86 — 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 (13 corresponding lines) · ×8
  • Edited copy of a member (13 corresponding lines) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1255 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:1255-1267 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1068-1081 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:3921 — REDACTED:3921-3934 | REDACTED:403-415 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) hypershift-operator/controllers/nodepool/metrics/metrics.go:408 — hypershift-operator/controllers/nodepool/metrics/metrics.go:408-420 | hypershift-operator/controllers/nodepool/metrics/metrics.go:423-435 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) control-plane-operator/controllers/azureprivatelinkservice/controller.go:193 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:193-209 | hypershift-operator/controllers/platform/azure/controller.go:122-134 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) hypershift-operator/controlplaneoperator-overrides/overrides.go:81 — hypershift-operator/controlplaneoperator-overrides/overrides.go:81-93 | hypershift-operator/controlplaneoperator-overrides/overrides.go:95-107 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) support/controlplane-component/deployment.go:132 — support/controlplane-component/deployment.go:132-144 | support/controlplane-component/statefulset.go:67-79 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) cmd/util/azure.go:50 — cmd/util/azure.go:50-62 | hack/tools/verify-api-deps/main.go:53-68 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) REDACTED:886 — REDACTED:886-899 | REDACTED:998-1010 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D5 · Coupling · Off the main sequence · ×8
  • Off the main sequence: github.com/openshift/cluster-api-provider-agent/api — github.com/openshift/cluster-api-provider-agent/api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-aws/v2 — sigs.k8s.io/cluster-api-provider-aws/v2: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-azure — sigs.k8s.io/cluster-api-provider-azure: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-gcp — sigs.k8s.io/cluster-api-provider-gcp: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-ibmcloud — sigs.k8s.io/cluster-api-provider-ibmcloud: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-kubevirt — sigs.k8s.io/cluster-api-provider-kubevirt: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: github.com/openshift/hypershift/api — github.com/openshift/hypershift/api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: sigs.k8s.io/cluster-api-provider-openstack — sigs.k8s.io/cluster-api-provider-openstack: abstractness 0.01, instability 0.00, distance 0.99 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1685 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1685-1701 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1703-1719 — 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) cmd/infra/azure/rbac.go:101 — cmd/infra/azure/rbac.go:101-117 | cmd/infra/azure/rbac.go:120-139 — 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) cmd/infra/gcp/networking.go:329 — cmd/infra/gcp/networking.go:329-345 | cmd/infra/gcp/networking.go:349-365 — 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) control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/scrape_config.go:73 — control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/scrape_config.go:73-89 | control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/scrape_config.go:139-155 — 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) hypershift-operator/controllers/hostedcluster/metrics/metrics.go:307 — hypershift-operator/controllers/hostedcluster/metrics/metrics.go:307-326 | hypershift-operator/controllers/nodepool/metrics/metrics.go:437-453 — 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) hypershift-operator/controllers/nodepool/capi.go:353 — hypershift-operator/controllers/nodepool/capi.go:353-369 | hypershift-operator/controllers/nodepool/capi.go:409-427 — 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) REDACTED:181 — REDACTED:181-199 | REDACTED:201-217 — 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 · Duplicated block (20 lines × 2) · ×7
  • Duplicated block (20 lines × 2) contrib/gomaxprocs-webhook/cmd/serve.go:154 — contrib/gomaxprocs-webhook/cmd/serve.go:154-173 | contrib/gomaxprocs-webhook/internal/config/loader.go:161-180 — 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. Check import visibility before settling on that home: `contrib/gomaxprocs-webhook/internal/config/loader.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (20 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:118 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:118-137 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:193-212 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:118` 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, `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:116` calls `generateGroupsClaimMapping` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:191` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20 lines × 2) hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:82 — hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:82-101 | hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:99-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (20 lines × 2) hypershift-operator/controllers/hostedcluster/metrics/metrics.go:616 — hypershift-operator/controllers/hostedcluster/metrics/metrics.go:616-635 | hypershift-operator/controllers/nodepool/metrics/metrics.go:528-547 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `hypershift-operator/controllers/nodepool/metrics/metrics.go:527` calls `emitAggregatedMetrics` and `hypershift-operator/controllers/hostedcluster/metrics/metrics.go:614` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:125 — pkg/capi/openstack/api/v1beta1/types.go:125-144 | pkg/capi/openstack/api/v1beta2/types.go:163-188 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (20 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:159 — pkg/capi/openstack/api/v1beta1/types.go:159-178 | pkg/capi/openstack/api/v1beta2/types.go:203-228 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (20 lines × 2) contrib/repo_metrics/weekly_pr_report.py:582 — contrib/repo_metrics/weekly_pr_report.py:582-601 | contrib/repo_metrics/weekly_pr_report.py:714-733 — both copies are in the same file, so extract the 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×6
  • Repeated repair: cmd/nodepool/gcp/create.go cmd/nodepool/gcp/create.go:135 — cmd/nodepool/gcp/create.go changed 11 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is CompletedGCPNodePoolCreateOptions.UpdateNodePool at line 135), 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: “fix(cli): align rebased command call sites”; “fix(gcp)!: require zone flag for cluster and nodepool creation”; “fix(gcp): share machine-type help text across CLI commands”; “fix(gcp): address nodepool CLI review feedback”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/nodepool/gcp/create.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.
  • Repeated repair: control-plane-operator/controllers/hostedcontrolplane/v2/router/component.go control-plane-operator/controllers/hostedcontrolplane/v2/router/component.go:78 — control-plane-operator/controllers/hostedcontrolplane/v2/router/component.go changed 8 times in last 90 days and 6 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 router.ensureHCPRouterBackendsReady at line 78), 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: “fix: address review feedback - simplify loop, rename function, add test coverage”; “fix: address review feedback on comment verbosity and test naming”; “fix: address review feedback on ClusterIP gating”; “fix: prevent router from starting before backend service IPs are assigned”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/v2/router/component.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.
  • Repeated repair: control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go:104 — control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is KarpenterOperatorOptions.adaptStandaloneDeployment at line 104), 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: “fix(karpenter): pass allocated UID to standalone karpenter-operator”; “fix(network): normalize literal endpoint authorities”; “fix: rename MY_NAME to POD_NAME in standalone karpenter-operator deployment”; “fix: inject token-minter image to standalone karpenter-operator”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.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.
  • Repeated repair: control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go:165 — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.go changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is gcp.normalizeReason at line 165), 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: “fix(gcp): GCP-1221 | require every operation error recoverable before degrading”; “fix(gcp): GCP-1221 | union both 400 reason surfaces, all must be transient”; “fix(gcp): GCP-1221 | treat mixed 400 reasons as terminal”; “fix(gcp): GCP-1221 | address firewall reconciler review feedback”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/errors.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.
  • Repeated repair: hypershift-operator/controllers/nodepool/config.go hypershift-operator/controllers/nodepool/config.go:104 — hypershift-operator/controllers/nodepool/config.go changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is nodepool.NewConfigGenerator at line 104), 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: “fix(nodepool): address predictable rollout review feedback”; “Revert "Merge pull request #8698 from csrwng/ocpstrat-3298-predictable-rollout"”; “fix(kubevirt): OCPBUGS-77307: override nmstate config for multus with IPv6”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- hypershift-operator/controllers/nodepool/config.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.
  • Repeated repair: cmd/cluster/azure/destroy.go cmd/cluster/azure/destroy.go:105 — cmd/cluster/azure/destroy.go changed 4 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 11 (its worst body is azure.DestroyCluster at line 105), 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: “fix(azure): make CI role assignment cleanup reproducible”; “fix(cli): preserve client injection and offline rendering”; “fix(azure): use DeletionFailed condition to orphan stuck AzureMachines during cluster deletion”. 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-19..2026-11-17, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-19 19:27:12 +00:00' --until='2026-11-17 19:27:12 +00:00' --full-history --no-merges -- cmd/cluster/azure/destroy.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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×6
  • Edited copy of a member (9 corresponding lines) cmd/cluster/none/destroy.go:42 — cmd/cluster/none/destroy.go:42-50 | cmd/cluster/openstack/destroy.go:49-57 — 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) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1283 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1283-1291 | control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1293-1301 — 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) cmd/infra/aws/ec2.go:221 — cmd/infra/aws/ec2.go:221-229 | cmd/infra/aws/ec2.go:231-242 — 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) hack/verify-tekton-pipeline-pairs.py:46 — hack/verify-tekton-pipeline-pairs.py:46-55 | hack/verify-tekton-pipeline-pairs.py:59-67 — 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) control-plane-operator/hostedclusterconfigoperator/operator/config.go:194 — control-plane-operator/hostedclusterconfigoperator/operator/config.go:194-202 | karpenter-operator/main.go:248-256 — 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) hack/tools/hypershiftlinter/analyzers/contextbackground/contextbackground.go:92 — hack/tools/hypershiftlinter/analyzers/contextbackground/contextbackground.go:92-100 | hack/tools/hypershiftlinter/analyzers/sippyannotation/sippyannotation.go:85-93 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:681 — control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:681-687 | control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:689-694 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/reencryption/reencryption.go:580 — control-plane-operator/hostedclusterconfigoperator/controllers/reencryption/reencryption.go:580-585 | support/azureutil/azureutil.go:278-283 — 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) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:222 — hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:222-227 | support/netutil/networking.go:61-66 — 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) control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:142 — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:142-147 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go:233-239 — 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) control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:267 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:267-272 | support/k8sutil/object.go:20-25 — 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) hack/tools/crd-schema-check/main.go:33 — hack/tools/crd-schema-check/main.go:33-38 | hack/tools/verify-api-deps/main.go:16-22 — 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 · Duplicated block (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:32 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:32-39 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:60-67 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:89-96 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (8 lines × 3) hypershift-operator/controllers/ignitionpayload/config.go:101 — hypershift-operator/controllers/ignitionpayload/config.go:101-108 | hypershift-operator/controllers/nodepool/config.go:400-407 | hypershift-operator/controllers/nodepool/nto.go:431-438 — `hypershift-operator/controllers/ignitionpayload/config.go` and `hypershift-operator/controllers/nodepool/config.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 90 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/ignitionpayload/config.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.
  • Duplicated block (8 lines × 3) REDACTED:3447 — REDACTED:3447-3454 | support/netutil/expose.go:7-14 | support/netutil/expose.go:42-49 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 3) cmd/infra/aws/route53.go:142 — cmd/infra/aws/route53.go:142-149 | cmd/infra/aws/route53.go:153-160 | cmd/infra/aws/route53.go:164-171 — all 3 copies are in the same file, so extract the block into one function there and call 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 `cmd/infra/aws/route53.go:142` 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 (8 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:117 — control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:117-124 | control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:155-162 | control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:166-173 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:127` calls `HashSimple` and `control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:175` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go:51 — control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go:51-58 | control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:86-93 | hypershift-operator/controllers/nodepool/nodepool_controller.go:214-221 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D6 · Cohesion (LCOM4) · Low cohesion · ×6
  • Low cohesion: NodePoolReconciler (LCOM4 9) hypershift-operator/controllers/nodepool/nodepool_controller.go:112 — NodePoolReconciler's methods fall into 9 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 9 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: APIServer (LCOM4 5) pkg/capi/openstack/api/v1beta2/openstackcluster_types.go:162 — APIServer's methods fall into 5 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 5 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: ClientProvider (LCOM4 4) cmd/util/client.go:40 — ClientProvider'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: AWS (LCOM4 4) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:64 — AWS'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: Azure (LCOM4 4) hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:43 — Azure'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: GCP (LCOM4 4) hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:67 — GCP'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.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) cmd/cluster/azure/destroy.go:37 — cmd/cluster/azure/destroy.go:37-74 | cmd/cluster/openstack/destroy.go:20-47 | cmd/cluster/powervs/destroy.go:20-72 | product-cli/cmd/cluster/openstack/destroy.go:14-41 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) cmd/infra/aws/create.go:169 — cmd/infra/aws/create.go:169-191 | cmd/infra/aws/create_iam.go:153-175 | cmd/infra/gcp/create_iam.go:110-133 | cmd/infra/gcp/create_infra.go:107-128 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:420 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:420-575 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:184-321 | REDACTED:269-384 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:155-219 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:473 — REDACTED:473-585 | REDACTED:705-822 | REDACTED:870-996 | REDACTED:998-1140 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/etcdcli/etcdcli.go:236 — pkg/etcdcli/etcdcli.go:236-252 | pkg/etcdcli/etcdcli.go:301-329 | pkg/etcdcli/etcdcli.go:341-362 | pkg/etcdcli/etcdcli.go:372-387 — 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 (27 corresponding lines) · ×5
  • Edited copy of a member (27 corresponding lines) REDACTED:252 — REDACTED:252-278 | REDACTED:320-352 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) REDACTED:263 — REDACTED:263-295 | REDACTED:787-813 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:108 — control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:108-149 | hypershift-operator/controllers/sharedingress/sharedingress_controller.go:384-410 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) hypershift-operator/controllers/nodepool/conditions.go:617 — hypershift-operator/controllers/nodepool/conditions.go:617-643 | hypershift-operator/controllers/nodepool/conditions.go:645-677 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) cmd/install/assets/hypershift_operator.go:1106 — cmd/install/assets/hypershift_operator.go:1106-1140 | cmd/install/assets/hypershift_operator.go:1146-1172 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×5
  • Edited copy of a member (30 corresponding lines) REDACTED:2259 — REDACTED:2259-2288 | REDACTED:6141-6175 — 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) cmd/infra/aws/iam.go:1275 — cmd/infra/aws/iam.go:1275-1307 | cmd/infra/aws/iam.go:1309-1338 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:108 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:108-137 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:180-212 — 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) hack/tools/hypershiftlinter/analyzers/contextbackground/contextbackground.go:18 — hack/tools/hypershiftlinter/analyzers/contextbackground/contextbackground.go:18-48 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:30-59 — 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) hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:97 — hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:97-127 | hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:130-159 — 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 (26 corresponding lines) · ×5
  • Edited copy of a member (26 corresponding lines) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:393 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:393-418 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:156-181 — 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) REDACTED:2092 — REDACTED:2092-2117 | REDACTED:2221-2252 — 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) cmd/kubeconfig/create.go:51 — cmd/kubeconfig/create.go:51-81 | product-cli/cmd/kubeconfig/create.go:40-65 — 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) cmd/cluster/kubevirt/create.go:154 — cmd/cluster/kubevirt/create.go:154-180 | REDACTED:89-114 — 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) cmd/install/assets/hypershift_operator.go:1268 — cmd/install/assets/hypershift_operator.go:1268-1293 | cmd/install/assets/hypershift_operator.go:1889-1914 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×5
  • Edited copy of a member (28 corresponding lines) cmd/infra/aws/route53.go:44 — cmd/infra/aws/route53.go:44-74 | support/awsutil/route53.go:28-55 — 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) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1038 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1038-1065 | hypershift-operator/controllers/platform/gcp/loadbalancer_labels_controller.go:348-375 — 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) control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:239 — control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:239-268 | control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:270-297 — 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) cmd/infra/aws/route53.go:344 — cmd/infra/aws/route53.go:344-371 | support/awsutil/route53.go:113-141 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:139 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:139-166 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:266-293 — 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 (24 corresponding lines) · ×5
  • Edited copy of a member (24 corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:18 — control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:18-41 | control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/setup.go:27-55 — 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) cmd/install/assets/hypershift_operator.go:1239 — cmd/install/assets/hypershift_operator.go:1239-1262 | cmd/install/assets/hypershift_operator.go:1679-1702 — 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) control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:94 — control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:94-125 | control-plane-operator/controllers/hostedcontrolplane/mcs/reconcile.go:127-150 — 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) cmd/bastion/aws/create.go:351 — cmd/bastion/aws/create.go:351-374 | cmd/bastion/aws/create.go:596-624 — 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) cmd/install/assets/hypershift_operator.go:2002 — cmd/install/assets/hypershift_operator.go:2002-2030 | cmd/install/assets/hypershift_operator.go:2147-2170 — 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 (22 corresponding lines) · ×5
  • Edited copy of a member (22 corresponding lines) REDACTED:158 — REDACTED:158-180 | REDACTED:196-217 — 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) REDACTED:339 — REDACTED:339-360 | REDACTED:439-464 — 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) control-plane-operator/controllers/azureprivatelinkservice/controller.go:841 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:841-862 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:876-901 — 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) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:850 — karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:850-872 | karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:875-896 — 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) control-plane-operator/controllers/hostedcontrolplane/creatorupdate_ownerref_enforcer.go:14 — control-plane-operator/controllers/hostedcontrolplane/creatorupdate_ownerref_enforcer.go:14-35 | hypershift-operator/controllers/hostedcluster/createorupdate_annotation_enforcer.go:14-39 — 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 (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) hypershift-operator/controllers/nodepool/aws.go:582 — hypershift-operator/controllers/nodepool/aws.go:582-614 | hypershift-operator/controllers/nodepool/nodepool_controller.go:909-933 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.go:48 — control-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.go:48-72 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/openstack/config.go:63-90 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) cmd/oadp/restore.go:264 — cmd/oadp/restore.go:264-292 | cmd/oadp/restore.go:294-318 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2712 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2712-2743 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2755-2779 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:193 — pkg/capi/openstack/api/v1beta1/types.go:193-217 | pkg/capi/openstack/api/v1beta2/types.go:243-283 — 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 · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) cmd/cluster/azure/create.go:640 — cmd/cluster/azure/create.go:640-658 | cmd/cluster/azure/create.go:680-698 — both copies are in the same file, so extract the 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, `cmd/cluster/azure/create.go:676` calls `AzureDiskStorageAccountType` and `cmd/cluster/azure/create.go:637` 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 (19 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:41 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:41-59 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:152-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (19 lines × 2) REDACTED:757 — REDACTED:757-775 | REDACTED:1083-1101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:757` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) REDACTED:1422 — REDACTED:1422-1440 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1018-1036 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1422` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:237 — pkg/capi/openstack/api/v1beta1/types.go:237-255 | pkg/capi/openstack/api/v1beta2/types.go:303-328 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×5
  • Duplicated block (12 lines × 3) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:480 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:480-491 | REDACTED:304-315 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:183-194 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:480` 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 × 3) hypershift-operator/controllers/ignitionpayload/config.go:130 — hypershift-operator/controllers/ignitionpayload/config.go:130-141 | hypershift-operator/controllers/nodepool/config.go:430-441 | hypershift-operator/controllers/nodepool/nto.go:460-471 — `hypershift-operator/controllers/ignitionpayload/config.go` and `hypershift-operator/controllers/nodepool/config.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 90 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 3) pkg/etcdcli/etcdcli.go:238 — pkg/etcdcli/etcdcli.go:238-249 | pkg/etcdcli/etcdcli.go:343-354 | pkg/etcdcli/etcdcli.go:374-385 — all 3 copies are in the same file, so extract the block into one function there and call 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.
  • Duplicated block (12 lines × 3) pkg/capi/aws/api/v1beta1/groupversion_info.go:27 — pkg/capi/aws/api/v1beta1/groupversion_info.go:27-38 | pkg/capi/aws/exp/api/v1beta1/groupversion_info.go:27-38 | pkg/capi/ibmcloud/api/v1beta1/groupversion_info.go:28-39 — before extracting anything, compare `pkg/capi/aws/api/v1beta1/groupversion_info.go` and `pkg/capi/aws/exp/api/v1beta1/groupversion_info.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 3) pkg/capi/aws/api/v1beta1/tags.go:48 — pkg/capi/aws/api/v1beta1/tags.go:48-59 | pkg/capi/aws/api/v1beta2/tags.go:48-59 | pkg/capi/azure/api/v1beta1/tags.go:58-69 — `pkg/capi/aws/api/v1beta1/tags.go` and `pkg/capi/aws/api/v1beta2/tags.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 2 separate duplicated blocks between them, totalling at least 57 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×5
  • Duplicated block (10 lines × 3) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1111 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:1111-1120 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:1136-1145 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:1238-1247 — all 3 copies are in the same file, so extract the block into one function there and call 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 `control-plane-operator/controllers/azureprivatelinkservice/controller.go:1111` 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 × 3) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:23 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:23-32 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/gcp/component.go:62-71 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/powervs/deployment.go:24-33 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/powervs/deployment.go:35` calls `UpdateVolume` and `control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:33` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131 — hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131-140 | hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:115-124 | hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:102-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:131` 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, `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:128` calls `Sprintf`, `Join` and `hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:112` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 3) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1269 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1269-1278 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1299-1308 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1351-1360 — all 3 copies are in the same file, so extract the block into one function there and call 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 `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) api/hypershift/v1beta1/hosted_controlplane.go:11 — api/hypershift/v1beta1/hosted_controlplane.go:11-20 | api/hypershift/v1beta1/hostedcluster_types.go:17-27 | api/hypershift/v1beta1/nodepool_types.go:60-69 — 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×5
  • Duplicated block (9–10 lines × 2) cmd/infra/aws/util/sts.go:47 — cmd/infra/aws/util/sts.go:47-56 | cmd/infra/aws/util/util.go:108-116 — 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 `cmd/infra/aws/util/sts.go:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) cmd/infra/powervs/destroy.go:481 — cmd/infra/powervs/destroy.go:481-490 | cmd/infra/powervs/validate.go:110-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/powervs/destroy.go:481` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:538 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:538-546 | REDACTED:351-360 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:538` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:538` is reached only past a guard at line 509 that tests `req.Namespace` and leaves the function early, and `REDACTED:351` reads `req.Namespace` 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 (9–10 lines × 2) REDACTED:172 — REDACTED:172-180 | REDACTED:217-226 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:172` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9–10 lines × 2) hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:94 — hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:94-102 | hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:109-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) cmd/infra/azure/create.go:65 — cmd/infra/azure/create.go:65-73 | product-cli/cmd/infra/azure/create.go:36-44 | product-cli/cmd/infra/azure/destroy.go:36-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/azure/create.go:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:65 — control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:65-73 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenter/component.go:65-73 | control-plane-operator/controllers/hostedcontrolplane/v2/machine_approver/component.go:62-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:65` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) api/hypershift/v1beta1/azureprivatelinkservice_types.go:8 — api/hypershift/v1beta1/azureprivatelinkservice_types.go:8-16 | api/hypershift/v1beta1/controlplanecomponent_types.go:8-16 | api/hypershift/v1beta1/endpointservice_types.go:8-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (9 lines × 3) hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:256 — hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:256-264 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:285-293 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:321-329 — all 3 copies are in the same file, so extract the block into one function there and call 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 `hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) REDACTED:209 — REDACTED:209-217 | REDACTED:262-270 | REDACTED:372-380 — all 3 copies are in the same file, so extract the block into one function there and call 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 `REDACTED:209` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2299 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2299-2304 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2362-2367 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2434-2439 — all 3 copies are in the same file, so extract the block into one function there and call 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 `control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2299` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) product-cli/cmd/iam/azure/create.go:43 — product-cli/cmd/iam/azure/create.go:43-48 | product-cli/cmd/iam/azure/destroy.go:42-47 | product-cli/cmd/infra/azure/destroy.go:40-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `product-cli/cmd/iam/azure/create.go:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 3) control-plane-operator/controllers/hostedcontrolplane/kas/kubeconfig.go:15 — control-plane-operator/controllers/hostedcontrolplane/kas/kubeconfig.go:15-20 | control-plane-operator/controllers/hostedcontrolplane/pki/kas.go:139-144 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:342-347 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (6 lines × 3) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:255 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:255-261 | REDACTED:330-335 | hypershift-operator/controllers/platform/azure/controller.go:190-196 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.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.
  • Duplicated block (6 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:25 — control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:25-30 | control-plane-operator/hostedclusterconfigoperator/controllers/machine/setup.go:103-108 | control-plane-operator/hostedclusterconfigoperator/controllers/node/setup.go:21-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. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:25` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/setup.go:32` calls `Watch`, `GetCache`, `EnqueueRequestsFromMapFunc` and `control-plane-operator/hostedclusterconfigoperator/controllers/machine/setup.go:110` 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×5
  • Outbound HTTP without resilience cmd/infra/powervs/destroy.go:680 — `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.
  • Outbound HTTP without resilience contrib/repo_metrics/weekly_pr_report.py:511 — `requests.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 hack/tools/release/notes.go:142 — `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.
  • Outbound HTTP without resilience support/forwarder/forwarder.go:45 — `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.
  • Outbound HTTP without resilience REDACTED:163 — `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.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×4
  • Dependency pinned to a stale untagged commit: github.com/armon/go-socks5 — Direct dependency `github.com/armon/go-socks5` is required at `v0.0.0-20160902184237-e75332964ef5` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2016-09-02, 10.2 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/armon/go-socks5` and has not moved this requirement in 10.2 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/armon/go-socks5` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/coreos/go-systemd — Direct dependency `github.com/coreos/go-systemd` is required at `v0.0.0-20191104093116-d3cd4ed1dbcf` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2019-11-04, 7 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/coreos/go-systemd` and has not moved this requirement in 7 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/coreos/go-systemd` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/openshift/custom-resource-status — Direct dependency `github.com/openshift/custom-resource-status` is required at `v1.1.3-0.20220503160415-f2fdb4999d87` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2022-05-03, 4.5 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/openshift/custom-resource-status` and has not moved this requirement in 4.5 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/openshift/custom-resource-status` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: sigs.k8s.io/kube-storage-version-migrator — Direct dependency `sigs.k8s.io/kube-storage-version-migrator` is required at `v0.0.6-0.20230721195810-5c8923c5ff96` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-21, 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 `sigs.k8s.io/kube-storage-version-migrator` 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 `sigs.k8s.io/kube-storage-version-migrator` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D17 · Explicit Debt · FixmeComment · ×4
  • FixmeComment test/e2e/util/util.go:2071 — // FIXME(stephenfin): investigate why this fails on OpenStack. DNS resolves — 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 test/e2e/util/reqserving/setup.go:242 — // FIXME: This should only fetch the default worker machinesets of a standalone cluster — 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 hypershift-operator/controllers/nodepool/capi.go:365 — // FIXME: In future we may want to use the spec field instead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment hypershift-operator/controllers/nodepool/capi.go:421 — // FIXME: In future we may want to use the spec field instead — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×4
  • Edited copy of a member (52 corresponding lines) cmd/cluster/aws/destroy.go:20 — cmd/cluster/aws/destroy.go:20-74 | product-cli/cmd/cluster/aws/destroy.go:13-64 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) control-plane-operator/controllers/azureprivatelinkservice/observer.go:80 — control-plane-operator/controllers/azureprivatelinkservice/observer.go:80-131 | control-plane-operator/controllers/gcpprivateserviceconnect/observer.go:62-116 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) REDACTED:50 — REDACTED:50-116 | REDACTED:127-178 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go:26 — pkg/capi/openstack/api/v1beta1/openstackmachinetemplate_types.go:26-77 | pkg/capi/openstack/api/v1beta2/openstackmachinetemplate_types.go:25-89 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×4
  • Edited copy of a member (44 corresponding lines) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:241 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:241-284 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:412-456 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) konnectivity-socks5-proxy/http_proxy.go:37 — konnectivity-socks5-proxy/http_proxy.go:37-80 | support/konnectivityproxy/proxy_dialer.go:26-70 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) hypershift-operator/controllers/nodepool/conditions.go:1048 — hypershift-operator/controllers/nodepool/conditions.go:1048-1091 | hypershift-operator/controllers/nodepool/conditions.go:1094-1141 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:26 — pkg/capi/openstack/api/v1beta1/types.go:26-69 | pkg/capi/openstack/api/v1beta2/types.go:28-74 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×4
  • Edited copy of a member (36 corresponding lines) REDACTED:2507 — REDACTED:2507-2542 | REDACTED:2707-2758 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) karpenter-operator/controllers/karpenter/karpenter_controller.go:368 — karpenter-operator/controllers/karpenter/karpenter_controller.go:368-403 | karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:226-261 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) REDACTED:428 — REDACTED:428-466 | REDACTED:1125-1160 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (36 corresponding lines) pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.go:25 — pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachinetemplate_types.go:25-65 | pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachinetemplate_types.go:24-59 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×4
  • Edited copy of a member (31 corresponding lines) hypershift-operator/controllers/nodepool/kubevirt.go:192 — hypershift-operator/controllers/nodepool/kubevirt.go:192-222 | hypershift-operator/controllers/nodepool/openstack.go:21-51 — 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) hypershift-operator/metrics.go:57 — hypershift-operator/metrics.go:57-91 | karpenter-operator/metrics.go:49-79 — 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) hypershift-operator/controllers/nodepool/conditions.go:131 — hypershift-operator/controllers/nodepool/conditions.go:131-161 | support/reconcilerpolicy/pausereconcile.go:52-82 — 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) control-plane-operator/controllers/hostedcontrolplane/cloud/azure/providerconfig.go:3 — control-plane-operator/controllers/hostedcontrolplane/cloud/azure/providerconfig.go:3-36 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/config.go:177-207 — 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 (21 corresponding lines) · ×4
  • Edited copy of a member (21 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:132 — control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:132-152 | support/globalconfig/namedcerts.go:12-39 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) cmd/infra/azure/create_iam.go:160 — cmd/infra/azure/create_iam.go:160-184 | cmd/infra/powervs/create.go:273-293 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) cmd/infra/azure/create_iam.go:95 — cmd/infra/azure/create_iam.go:95-115 | cmd/infra/azure/destroy_iam.go:79-99 — 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) REDACTED:621 — REDACTED:621-641 | hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:410-430 — 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 copies of one member (3 members, 13+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 13+ corresponding lines) support/k8sutil/object.go:27 — support/k8sutil/object.go:27-40 | support/statuspatching/statuspatching.go:27-41 | support/statuspatching/statuspatching.go:48-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) REDACTED:144 — REDACTED:144-156 | REDACTED:182-194 | REDACTED:219-236 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) support/imageregistry/imagemetadata.go:425 — support/imageregistry/imagemetadata.go:425-437 | support/imageregistry/imagemetadata.go:440-452 | support/imageregistry/imagemetadata.go:455-467 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) cmd/util/client.go:158 — cmd/util/client.go:158-170 | cmd/util/client.go:187-201 | REDACTED:480-492 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×4
  • Edited copy of a member (7 corresponding lines) REDACTED:658 — REDACTED:658-665 | support/awsutil/route53.go:455-461 — 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) REDACTED:225 — REDACTED:225-232 | cmd/cluster/none/create.go:79-85 — 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) control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go:80 — control-plane-operator/controllers/hostedcontrolplane/ignition/reconcile.go:80-86 | hypershift-operator/controllers/ignitionpayload/token.go:136-142 — 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) hack/tools/crd-schema-check/main.go:272 — hack/tools/crd-schema-check/main.go:272-278 | hypershift-operator/controlplaneoperator-overrides/overrides.go:117-123 — 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 · Duplicated block (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:56 — control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:56-72 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenter/component.go:56-72 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:56` 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 (17 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:21 — control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:21-37 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:364-380 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) hypershift-operator/controllers/hostedcluster/network_policies.go:463 — hypershift-operator/controllers/hostedcluster/network_policies.go:463-479 | hypershift-operator/controllers/hostedcluster/network_policies.go:486-502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/network_policies.go:463` 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 (17 lines × 2) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1267 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1267-1283 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1297-1313 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1267` 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×4
  • Duplicated block (14 lines × 3) cmd/install/assets/crds/assets.go:111 — cmd/install/assets/crds/assets.go:111-124 | cmd/install/assets/hypershift_operator.go:2512-2525 | control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:77-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/install/assets/crds/assets.go:111` 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 (14 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:130 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:130-143 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:160-173 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/ibmcloud.go:85-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:130` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2283 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2283-2296 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2346-2359 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2418-2431 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (14 lines × 3) REDACTED:2527 — REDACTED:2527-2540 | REDACTED:2740-2753 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1600-1613 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2527` 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.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×4
  • Duplicated block (7 lines × 4) REDACTED:998 — REDACTED:998-1004 | REDACTED:2408-2414 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:602-608 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1419-1425 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:998` it does not close everything it opens, so those 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, `REDACTED:1005` calls `IsNotFound` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1426` 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 × 4) hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:488 — hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:488-494 | support/netutil/networking.go:9-15 | support/netutil/networking.go:17-23 | support/netutil/networking.go:33-39 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Check import visibility before settling on that home: `hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go` sits under a restricted `internal` directory, which only code inside its own subtree is permitted to import from — so it is reachable from some of these sites and not from others, and being able to see the copies is not the same as being allowed to share them. The home has to be somewhere every one of these sites is permitted to import from; if there is no such place, that restriction may be exactly why the copies are separate.
  • Duplicated block (7 lines × 4) control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:47 — control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:47-55 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1150-1158 | control-plane-operator/controllers/healthcheck/gcp.go:140-146 | control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/client.go:98-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 4) hypershift-operator/controllers/hostedclustersizing/setup.go:87 — hypershift-operator/controllers/hostedclustersizing/setup.go:87-93 | REDACTED:81-88 | hypershift-operator/controllers/scheduler/aws/placeholders.go:109-115 | hypershift-operator/controllers/scheduler/aws/placeholders.go:122-128 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedclustersizing/setup.go:87` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) control-plane-operator/controllers/hostedcontrolplane/pki/cluster_storage_operator.go:11 — control-plane-operator/controllers/hostedcontrolplane/pki/cluster_storage_operator.go:11-17 | control-plane-operator/controllers/hostedcontrolplane/pki/csi_snapshot_controller_operator.go:11-17 | control-plane-operator/controllers/hostedcontrolplane/pki/registryoperator.go:11-17 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (7 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.go:22 — control-plane-operator/controllers/hostedcontrolplane/v2/kcm/deployment.go:22-28 | control-plane-operator/controllers/hostedcontrolplane/v2/kube_scheduler/deployment.go:49-55 | control-plane-operator/controllers/hostedcontrolplane/v2/ocm/deployment.go:22-28 — 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) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:503 — control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:503-509 | control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:84-90 | hypershift-operator/controllers/sharedingress/router.go:235-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:503` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 3) REDACTED:778 — REDACTED:778-784 | REDACTED:798-804 | REDACTED:1117-1123 — all 3 copies are in the same file, so extract the block into one function there and call 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×4
  • Sync-over-async blocking contrib/repo_metrics/weekly_pr_report.py:87 — `_fetch_json` is async and calls requests.post, requests.get, time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
  • Sync-over-async blocking contrib/repo_metrics/weekly_pr_report.py:410 — `_github_graphql_request` is async and calls requests.post, time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
  • Sync-over-async blocking contrib/repo_metrics/weekly_pr_report.py:478 — `fetch_repository_contributors` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
  • Sync-over-async blocking contrib/repo_metrics/weekly_pr_report.py:616 — `fetch_release_prs_graphql` is async and calls requests.get — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
X3 · Exception handling · Lost error (reports an error that is nil on this path) · ×4
  • Lost error (reports an error that is nil on this path) hypershift-operator/controllers/nodepool/capi.go:239 — `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.
  • Lost error (reports an error that is nil on this path) hypershift-operator/controllers/nodepool/token.go:260 — `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.
  • Lost error (reports an error that is nil on this path) hypershift-operator/controllers/nodepool/token.go:279 — `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.
  • Lost error (reports an error that is nil on this path) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:616 — `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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×3
  • Edited copy of a member (60 corresponding lines) hypershift-operator/controllers/nodepool/capi.go:627 — hypershift-operator/controllers/nodepool/capi.go:627-686 | hypershift-operator/controllers/nodepool/capi.go:693-758 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (60 corresponding lines) pkg/capi/aws/api/v1beta1/network_types.go:490 — pkg/capi/aws/api/v1beta1/network_types.go:490-549 | pkg/capi/aws/api/v1beta2/network_types.go:1046-1105 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (60 corresponding lines) pkg/capi/aws/api/v1beta1/tags.go:131 — pkg/capi/aws/api/v1beta1/tags.go:131-190 | pkg/capi/aws/api/v1beta2/tags.go:131-201 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×3
  • Edited copy of a member (40 corresponding lines) cmd/nodepool/create.go:25 — cmd/nodepool/create.go:25-66 | product-cli/cmd/nodepool/create.go:15-54 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1208 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1208-1255 | control-plane-operator/controllers/hostedcontrolplane/aws_ingress_dns.go:251-290 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (40 corresponding lines) REDACTED:3880 — REDACTED:3880-3919 | REDACTED:6231-6270 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×3
  • Edited copy of a member (29 corresponding lines) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:160 — hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:160-188 | hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:461-489 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) hypershift-operator/controllers/hostedcluster/internal/proxy/validation.go:41 — hypershift-operator/controllers/hostedcluster/internal/proxy/validation.go:41-69 | hypershift-operator/controllers/hostedcluster/internal/proxy/validation.go:73-105 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) pkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.go:24 — pkg/capi/openstack/api/v1beta1/openstackclustertemplate_types.go:24-52 | pkg/capi/openstack/api/v1beta2/openstackclustertemplate_types.go:25-68 — 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 (35 corresponding lines) · ×3
  • Edited copy of a member (35 corresponding lines) REDACTED:90 — REDACTED:90-124 | REDACTED:90-124 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) REDACTED:42 — REDACTED:42-85 | product-cli/main.go:44-78 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (35 corresponding lines) pkg/capi/aws/api/v1beta1/network_types.go:242 — pkg/capi/aws/api/v1beta1/network_types.go:242-276 | pkg/capi/aws/api/v1beta2/network_types.go:619-701 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:373 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:373-391 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.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) support/controlplane-component/defaults.go:554 — support/controlplane-component/defaults.go:554-573 | support/controlplane-component/defaults.go:575-590 — 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) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:223 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:223-243 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:357-372 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 16+ corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:124 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:124-141 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:179-194 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:196-217 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:343 — hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:343-361 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:400-415 | hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:417-432 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) cmd/install/assets/crds/assets.go:109 — cmd/install/assets/crds/assets.go:109-124 | cmd/install/assets/hypershift_operator.go:2510-2525 | control-plane-operator/controllers/hostedcontrolplane/csi/kubevirt/kubevirt.go:75-90 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 14+ corresponding lines) · ×3
  • Edited copies of one member (4 members, 14+ corresponding lines) control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:46 — control-plane-operator/controllers/gcpprivateserviceconnect/dns.go:46-65 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1149-1174 | control-plane-operator/controllers/healthcheck/gcp.go:139-152 | control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/client.go:97-117 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) hypershift-operator/controllers/hostedcluster/network_policies.go:596 — hypershift-operator/controllers/hostedcluster/network_policies.go:596-613 | hypershift-operator/controllers/hostedcluster/network_policies.go:615-632 | hypershift-operator/controllers/hostedcluster/network_policies.go:843-860 | hypershift-operator/controllers/hostedcluster/network_policies.go:862-875 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 14+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/assets/assets.go:127 — control-plane-operator/controllers/hostedcontrolplane/v2/assets/assets.go:127-141 | support/controlplane-component/cronjob.go:34-47 | support/controlplane-component/deployment.go:85-98 | support/controlplane-component/job.go:35-48 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 11+ corresponding lines) hypershift-operator/controllers/platform/gcp/loadbalancer_labels_controller.go:79 — hypershift-operator/controllers/platform/gcp/loadbalancer_labels_controller.go:79-89 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:69-82 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:84-97 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) cmd/infra/aws/iam.go:1376 — cmd/infra/aws/iam.go:1376-1386 | cmd/infra/aws/iam.go:1388-1400 | cmd/infra/aws/iam.go:1402-1416 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/manifests/azure_disk_csi_driver_operator.go:9 — control-plane-operator/controllers/hostedcontrolplane/manifests/azure_disk_csi_driver_operator.go:9-19 | control-plane-operator/controllers/hostedcontrolplane/manifests/azure_file_csi_driver_operator.go:9-19 | control-plane-operator/controllers/hostedcontrolplane/manifests/nto.go:9-19 — 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 copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:566 — hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:566-573 | hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:575-582 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/capi/aws/api/v1beta1/network_types.go:319 — pkg/capi/aws/api/v1beta1/network_types.go:319-326 | pkg/capi/aws/api/v1beta2/network_types.go:801-811 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:759 — control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:759-766 | hypershift-operator/controllers/nodepool/manifests.go:19-26 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×3
  • Edited copy of a member (3 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:922 — pkg/capi/openstack/api/v1beta1/types.go:922-924 | pkg/capi/openstack/api/v1beta2/types.go:1081-1083 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (3 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:118 — pkg/capi/openstack/api/v1beta1/types.go:118-120 | pkg/capi/openstack/api/v1beta2/types.go:156-158 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (3 corresponding lines) cmd/cluster/core/create.go:932 — cmd/cluster/core/create.go:932-934 | karpenter-operator/crd_wait.go:102-108 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 · Duplicated block (52 lines × 2) · ×3
  • Duplicated block (52 lines × 2) pkg/capi/aws/api/v1beta1/conditions_consts.go:21 — pkg/capi/aws/api/v1beta1/conditions_consts.go:21-72 | pkg/capi/aws/api/v1beta2/conditions_consts.go:21-72 — `pkg/capi/aws/api/v1beta1/conditions_consts.go` and `pkg/capi/aws/api/v1beta2/conditions_consts.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 2 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/api/v1beta1/conditions_consts.go:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (52 lines × 2) pkg/capi/aws/api/v1beta1/network_types.go:492 — pkg/capi/aws/api/v1beta1/network_types.go:492-543 | pkg/capi/aws/api/v1beta2/network_types.go:1048-1099 — 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 `pkg/capi/aws/api/v1beta1/network_types.go:492` it does not close everything it opens, so those 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 (52 lines × 2) REDACTED:519 — REDACTED:519-570 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:100-151 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:519` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (37 lines × 2) · ×3
  • Duplicated block (37 lines × 2) hypershift-operator/controllers/nodepool/capi.go:984 — hypershift-operator/controllers/nodepool/capi.go:984-1020 | hypershift-operator/controllers/nodepool/capi.go:1288-1324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (37 lines × 2) konnectivity-socks5-proxy/http_proxy.go:38 — konnectivity-socks5-proxy/http_proxy.go:38-74 | support/konnectivityproxy/proxy_dialer.go:27-63 — before extracting anything, compare `konnectivity-socks5-proxy/http_proxy.go` and `support/konnectivityproxy/proxy_dialer.go` as WHOLE FILES: 90% 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. Read the line range as the matched WINDOW rather than a finished unit: at `konnectivity-socks5-proxy/http_proxy.go:38` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `support/konnectivityproxy/proxy_dialer.go:64` calls `Close` and `konnectivity-socks5-proxy/http_proxy.go:75` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (37 lines × 2) pkg/capi/aws/api/v1beta1/awsmachinetemplate_types.go:36 — pkg/capi/aws/api/v1beta1/awsmachinetemplate_types.go:36-72 | pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go:82-119 — `pkg/capi/aws/api/v1beta1/awsmachinetemplate_types.go` and `pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×3
  • Duplicated block (27 lines × 2) hypershift-operator/controllers/nodepool/conditions.go:467 — hypershift-operator/controllers/nodepool/conditions.go:467-493 | hypershift-operator/controllers/nodepool/conditions.go:570-596 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/conditions.go:467` 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 lines × 2) support/imageregistry/imagemetadata.go:368 — support/imageregistry/imagemetadata.go:368-394 | REDACTED:267-293 — 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 (27 lines × 2) control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go:14 — control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go:14-40 | control-plane-operator/controllers/hostedcontrolplane/v2/cvo/deployment.go:307-337 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/cvo/deployment.go` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:474 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:474-498 | REDACTED:298-322 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:125 — control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:125-149 | hypershift-operator/controllers/sharedingress/sharedingress_controller.go:386-410 — 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 `control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:125` 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 (25 lines × 2) REDACTED:41 — REDACTED:41-65 | REDACTED:41-65 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:427 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:427-448 | REDACTED:275-296 — 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 `control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:145 — control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:145-166 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:272-293 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 118 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/kas/auth.go:145` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) api/certificates/v1alpha1/certificatesigningrequestapproval_types.go:13 — api/certificates/v1alpha1/certificatesigningrequestapproval_types.go:13-34 | api/hypershift/v1beta1/certificatesigningrequestapproval_types.go:13-46 — 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:37 — control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:37-51 | control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:90-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 `control-plane-operator/controllers/hostedcontrolplane/controlplaneversion.go:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–16 lines × 2) REDACTED:346 — REDACTED:346-360 | REDACTED:449-464 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:346` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15–16 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:232 — control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:232-247 | control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go:115-129 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:232` 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×3
  • Duplicated block (13–15 lines × 2) cmd/cluster/aws/create.go:365 — cmd/cluster/aws/create.go:365-377 | cmd/cluster/gcp/create.go:353-367 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/aws/create.go:365` it does not close everything it opens, so those exact lines 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–15 lines × 2) REDACTED:259 — REDACTED:259-271 | REDACTED:330-344 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:259` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13–15 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/olm/catalog_operator/deployment.go:15 — control-plane-operator/controllers/hostedcontrolplane/v2/olm/catalog_operator/deployment.go:15-29 | control-plane-operator/controllers/hostedcontrolplane/v2/olm/olm_operator/deployment.go:15-27 — `control-plane-operator/controllers/hostedcontrolplane/v2/olm/catalog_operator/deployment.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/olm/olm_operator/deployment.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 15 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×3
  • Duplicated block (14–15 lines × 2) hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:275 — hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:275-288 | hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:337-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:291` calls `PersistentVolumeAccessMode` and `hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:353` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–15 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:55 — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:55-68 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:38-52 — `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.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 41 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:55` 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, `control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:37` calls `RemoveInitContainer` and `control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:54` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–15 lines × 2) REDACTED:237 — REDACTED:237-250 | REDACTED:304-318 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) cmd/cluster/azure/create.go:567 — cmd/cluster/azure/create.go:567-579 | cmd/cluster/azure/create.go:593-606 — both copies are in the same file, so extract the 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 `cmd/cluster/azure/create.go:593` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:22 — control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:22-34 | control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/gcp/component.go:61-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment.go:22` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) hypershift-operator/controllers/nodepool/capi.go:1446 — hypershift-operator/controllers/nodepool/capi.go:1446-1459 | support/netutil/route.go:53-65 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:1446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • Duplicated block (11–12 lines × 2) cmd/infra/azure/destroy.go:59 — cmd/infra/azure/destroy.go:59-70 | cmd/infra/powervs/destroy.go:121-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/azure/destroy.go:59` 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–12 lines × 2) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1606 — hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1606-1617 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1665-1675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1606` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–12 lines × 2) REDACTED:432 — REDACTED:432-442 | REDACTED:58-69 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) REDACTED:2156 — REDACTED:2156-2163 | REDACTED:2186-2193 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1276-1283 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1306-1313 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2156` 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 (8 lines × 4) hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:231 — hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:231-238 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:296-303 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:332-339 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:367-374 — 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 `hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) REDACTED:138 — REDACTED:138-145 | control-plane-pki-operator/certificatesigningcontroller/certificatesigningcontroller.go:70-77 | control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go:64-71 | control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go:73-82 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
X3 · Exception handling · Discarded error (assigned to `_`, then its result used) · ×3
  • Discarded error (assigned to `_`, then its result used) support/releaseinfo/cincinnati_version_resolver.go:127 — `body, _ := io.ReadAll(resp.Body)` writes the call's error to `_` and then uses `body` as if the call succeeded. When `io.ReadAll` fails, `body` 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 `body` (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) hypershift-operator/controllers/platform/azure/controller.go:856 — `_, candidateCIDR, _ := net.ParseCIDR(candidate)` writes the call's error to `_` and then uses `candidateCIDR` as if the call succeeded. When `net.ParseCIDR` fails, `candidateCIDR` 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 `candidateCIDR` (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:4773 — `isTrue, _ := strconv.ParseBool(val)` writes the call's error to `_` and then uses `isTrue` as if the call succeeded. When `strconv.ParseBool` fails, `isTrue` 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 `isTrue` (return it, wrapped with what was being done), or, if the failure genuinely cannot matter, say why in a comment on the line.
D1 · Cyclomatic Complexity · RawCreateOptions.Validate (cyclomatic 20) · ×2
  • RawCreateOptions.Validate (cyclomatic 20) cmd/cluster/gcp/create.go:165 — RawCreateOptions.Validate has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • RawCreateOptions.Validate (cyclomatic 20) cmd/cluster/kubevirt/create.go:74 — RawCreateOptions.Validate 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.
D1 · Cyclomatic Complexity · oauth.transportForCARef (cyclomatic 19) · ×2
  • oauth.transportForCARef (cyclomatic 19) REDACTED:642 — oauth.transportForCARef 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.
  • oauth.transportForCARef (cyclomatic 19) REDACTED:712 — oauth.transportForCARef 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.
D2 · Cognitive Complexity · oauth.transportForCARef (cognitive 32) · ×2
  • oauth.transportForCARef (cognitive 32) REDACTED:642 — oauth.transportForCARef has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (32 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • oauth.transportForCARef (cognitive 32) REDACTED:712 — oauth.transportForCARef has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (32 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oauth.convertOpenIDIDP (cognitive 16) · ×2
  • oauth.convertOpenIDIDP (cognitive 16) REDACTED:280 — oauth.convertOpenIDIDP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (3 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.
  • oauth.convertOpenIDIDP (cognitive 16) REDACTED:354 — oauth.convertOpenIDIDP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (3 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.
D2 · Cognitive Complexity · IngressRule.Equals (cognitive 16) · ×2
  • IngressRule.Equals (cognitive 16) pkg/capi/aws/api/v1beta1/network_types.go:490 — IngressRule.Equals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3, boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • IngressRule.Equals (cognitive 16) pkg/capi/aws/api/v1beta2/network_types.go:1046 — IngressRule.Equals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3, boolean chains 2, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (7 members, 50+ identical tokens) control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:598 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:598-616 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:645-663 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:784-802 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:804-822 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:870-888 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:905-923 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:943-961 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
  • Members sharing a duplicated core (7 members, 50+ identical tokens) hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:82 — hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:82-161 | hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:105-291 | hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:99-289 | hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:196-291 | hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:84-192 | hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:186-383 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:85-202 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) cmd/cluster/powervs/create.go:243 — cmd/cluster/powervs/create.go:243-278 | etcd-defrag/main.go:29-58 | REDACTED:102-145 | kas-bootstrap/main.go:20-47 | sync-fg-configmap/update.go:30-63 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:199 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:199-218 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:220-241 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:243-264 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/token_webhook.go:47-75 | support/controlplane-component/kubeconfig.go:21-37 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×2
  • Edited copy of a member (46 corresponding lines) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1037 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1037-1085 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:532-577 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (46 corresponding lines) cmd/bastion/aws/create.go:47 — cmd/bastion/aws/create.go:47-98 | cmd/bastion/aws/destroy.go:35-80 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) cmd/infra/azure/create_iam.go:29 — cmd/infra/azure/create_iam.go:29-70 | cmd/infra/azure/destroy_iam.go:20-58 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (39 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:78 — pkg/capi/openstack/api/v1beta1/types.go:78-116 | pkg/capi/openstack/api/v1beta2/types.go:114-154 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) REDACTED:5002 — REDACTED:5002-5056 | REDACTED:5060-5100 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (41 corresponding lines) pkg/capi/aws/api/v1beta1/network_types.go:439 — pkg/capi/aws/api/v1beta1/network_types.go:439-479 | pkg/capi/aws/api/v1beta2/network_types.go:957-1014 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) cmd/infra/gcp/create_infra.go:46 — cmd/infra/gcp/create_infra.go:46-81 | cmd/infra/gcp/destroy_infra.go:22-53 — 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) REDACTED:128 — REDACTED:128-161 | REDACTED:170-201 — 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 (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:18 — control-plane-operator/controllers/hostedcontrolplane/v2/fg/job.go:18-60 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:363-396 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/component.go:35 — control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/component.go:35-70 | control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/component.go:34-67 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 22+ corresponding lines) cmd/infra/aws/destroy.go:741 — cmd/infra/aws/destroy.go:741-762 | cmd/infra/aws/destroy.go:847-868 | cmd/infra/aws/destroy.go:870-891 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 22+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:51 — control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/component.go:51-73 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenter/component.go:52-73 | control-plane-operator/controllers/hostedcontrolplane/v2/machine_approver/component.go:48-70 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 15+ corresponding lines) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1226 — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1226-1240 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:985-999 | control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:595-620 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) cmd/install/assets/hypershift_operator.go:1762 — cmd/install/assets/hypershift_operator.go:1762-1776 | cmd/install/assets/hypershift_operator.go:1778-1792 | cmd/install/assets/hypershift_operator.go:1794-1808 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:824 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:824-837 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:890-903 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:925-941 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) hypershift-operator/controllers/hostedcluster/etcd_recovery.go:359 — hypershift-operator/controllers/hostedcluster/etcd_recovery.go:359-372 | REDACTED:3538-3554 | hypershift-operator/controllers/manifests/controlplanepkioperator/reconcile.go:65-79 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (4 members, 7+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/configoperator/podmonitor.go:11 — control-plane-operator/controllers/hostedcontrolplane/v2/configoperator/podmonitor.go:11-17 | control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/podmonitor.go:11-17 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/servicemonitor.go:13-21 | control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/podmonitor.go:11-17 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
  • Edited copies of one member (4 members, 7+ corresponding lines) api/util/ipnet/ipnet.go:25 — api/util/ipnet/ipnet.go:25-31 | REDACTED:686-692 | pkg/capi/aws/api/v1beta1/network_types.go:297-303 | pkg/capi/aws/api/v1beta2/network_types.go:775-781 — 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 · Duplicated block (44 lines × 2) · ×2
  • Duplicated block (44 lines × 2) pkg/capi/aws/api/v1beta1/conditions_consts.go:131 — pkg/capi/aws/api/v1beta1/conditions_consts.go:131-174 | pkg/capi/aws/api/v1beta2/conditions_consts.go:154-197 — `pkg/capi/aws/api/v1beta1/conditions_consts.go` and `pkg/capi/aws/api/v1beta2/conditions_consts.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 2 separate duplicated blocks between them, totalling at least 96 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/api/v1beta1/conditions_consts.go:131` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (44 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:450 — pkg/capi/openstack/api/v1beta1/types.go:450-493 | pkg/capi/openstack/api/v1beta2/types.go:537-593 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/openstack/api/v1beta1/types.go:450` 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×2
  • Duplicated block (28 lines × 2) REDACTED:97 — REDACTED:97-124 | REDACTED:97-124 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:97` 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 (28 lines × 2) pkg/capi/agent/v1alpha1/agentmachinetemplate_types.go:24 — pkg/capi/agent/v1alpha1/agentmachinetemplate_types.go:24-51 | pkg/capi/agent/v1beta1/agentmachinetemplate_types.go:24-51 — `pkg/capi/agent/v1alpha1/agentmachinetemplate_types.go` and `pkg/capi/agent/v1beta1/agentmachinetemplate_types.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 28 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) REDACTED:454 — REDACTED:454-482 | REDACTED:70-98 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:454` 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 (29 lines × 2) control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:142 — control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:142-170 | control-plane-operator/controllers/hostedcontrolplane/v2/storage/component.go:169-197 — 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 `control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:142` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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.
D4 · Code Duplication · Duplicated block (23 lines × 3) · ×2
  • Duplicated block (23 lines × 3) hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:164 — hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:164-186 | hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:265-287 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:173-195 — 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 (23 lines × 3) REDACTED:65 — REDACTED:65-87 | REDACTED:135-157 | REDACTED:193-215 — all 3 copies are in the same file, so extract the block into one function there and call 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 `REDACTED:65` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×2
  • Duplicated block (20–22 lines × 2) cmd/nodepool/core/create.go:252 — cmd/nodepool/core/create.go:252-273 | hypershift-operator/controllers/nodepool/conditions.go:1231-1250 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/nodepool/core/create.go:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–22 lines × 2) hypershift-operator/controllers/nodepool/capi.go:837 — hypershift-operator/controllers/nodepool/capi.go:837-856 | hypershift-operator/controllers/nodepool/capi.go:1196-1217 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×2
  • Duplicated block (17–18 lines × 2) cmd/bastion/aws/create.go:71 — cmd/bastion/aws/create.go:71-88 | cmd/bastion/aws/destroy.go:53-69 — before extracting anything, compare `cmd/bastion/aws/create.go` and `cmd/bastion/aws/destroy.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/bastion/aws/create.go:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17–18 lines × 2) cmd/infra/powervs/validate.go:120 — cmd/infra/powervs/validate.go:120-136 | cmd/infra/powervs/validate.go:177-194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/powervs/validate.go:120` 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×2
  • Duplicated block (15–18 lines × 2) REDACTED:83 — REDACTED:83-97 | control-plane-operator/metrics-proxy/cmd.go:115-132 — 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 `REDACTED:83` it does not close everything it opens, so those exact lines 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–18 lines × 2) hypershift-operator/controllers/nodepool/conditions.go:619 — hypershift-operator/controllers/nodepool/conditions.go:619-636 | hypershift-operator/controllers/nodepool/conditions.go:646-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) pkg/capi/aws/api/v1beta1/bastion.go:28 — pkg/capi/aws/api/v1beta1/bastion.go:28-45 | pkg/capi/aws/api/v1beta2/bastion.go:28-45 — `pkg/capi/aws/api/v1beta1/bastion.go` and `pkg/capi/aws/api/v1beta2/bastion.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 18 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 (18 lines × 2) hypershift-operator/controllers/nodepool/capi.go:792 — hypershift-operator/controllers/nodepool/capi.go:792-809 | hypershift-operator/controllers/nodepool/capi.go:1237-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:792` 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) REDACTED:557 — REDACTED:557-567 | REDACTED:965-977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:557` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11–13 lines × 2) hypershift-operator/controllers/ignitionpayload/controller.go:493 — hypershift-operator/controllers/ignitionpayload/controller.go:493-503 | hypershift-operator/controllers/nodepool/config.go:582-594 — 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 `hypershift-operator/controllers/ignitionpayload/controller.go:493` 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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) cmd/infra/aws/create.go:180 — cmd/infra/aws/create.go:180-191 | cmd/infra/aws/create_iam.go:164-175 | cmd/infra/gcp/create_iam.go:122-133 | cmd/infra/gcp/create_infra.go:117-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/infra/aws/create.go:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 4) cmd/install/assets/hypershift_operator.go:1241 — cmd/install/assets/hypershift_operator.go:1241-1252 | cmd/install/assets/hypershift_operator.go:1681-1692 | cmd/install/assets/hypershift_operator.go:2004-2015 | cmd/install/assets/hypershift_operator.go:2149-2160 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) REDACTED:260 — REDACTED:260-270 | REDACTED:349-359 | REDACTED:550-560 — all 3 copies are in the same file, so extract the block into one function there and call 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 `REDACTED:260` 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 × 3) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:200 — control-plane-operator/controllers/hostedcontrolplane/kas/service.go:200-210 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:448-458 | control-plane-operator/controllers/hostedcontrolplane/oauth/service.go:102-112 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/kas/service.go:200` 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) hypershift-operator/controllers/ignitionpayload/controller.go:275 — hypershift-operator/controllers/ignitionpayload/controller.go:275-285 | hypershift-operator/controllers/ignitionpayload/controller.go:311-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/ignitionpayload/controller.go:275` 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–11 lines × 2) hypershift-operator/controllers/nodepool/capi.go:204 — hypershift-operator/controllers/nodepool/capi.go:204-213 | hypershift-operator/controllers/nodepool/capi.go:233-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:204` 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.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×2
  • Duplicated block (9 lines × 7) cmd/cluster/agent/create.go:164 — cmd/cluster/agent/create.go:164-172 | cmd/cluster/azure/create.go:54-62 | cmd/cluster/kubevirt/create.go:337-345 | cmd/cluster/none/create.go:112-120 | REDACTED:282-290 | product-cli/cmd/cluster/agent/create.go:23-31 | product-cli/cmd/cluster/azure/create.go:28-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/agent/create.go:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/cluster/agent/create.go:163` calls `MarkFlagRequired` and `cmd/cluster/azure/create.go:53` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 7) hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:98 — hypershift-operator/controllers/hostedcluster/internal/platform/agent/agent.go:98-106 | hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:130-138 | hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:114-122 | hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:227-235 | hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:101-109 | hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:216-224 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:102-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:128` calls `Sprintf`, `Join` and `hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:112` 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×2
  • Duplicated block (6 lines × 5) pkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.go:358 — pkg/capi/ibmcloud/api/v1beta2/ibmpowervscluster_types.go:358-363 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.go:149-154 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go:289-294 | pkg/capi/ibmcloud/api/v1beta2/ibmvpccluster_types.go:427-432 | pkg/capi/ibmcloud/api/v1beta2/ibmvpcmachine_types.go:250-255 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
  • Duplicated block (6 lines × 5) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:202 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:202-207 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:223-228 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:246-251 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/token_webhook.go:50-55 | support/controlplane-component/kubeconfig.go:24-29 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:202` 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • Duplicated block (5 lines × 3) product-cli/cmd/iam/azure/create.go:20 — product-cli/cmd/iam/azure/create.go:20-24 | product-cli/cmd/iam/azure/destroy.go:20-24 | product-cli/cmd/infra/azure/destroy.go:20-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:78 — hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:78-82 | hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:91-95 | hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:105-109 — all 3 copies are in the same file, so extract the block into one function there and call 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 `hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:78` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) hypershift-operator/controllers/nodepool/capi.go:335 — hypershift-operator/controllers/nodepool/capi.go:335-347 | hypershift-operator/controllers/nodepool/capi.go:377-389 | hypershift-operator/controllers/nodepool/capi.go:435-447 — all 3 copies are in the same file, so extract the block into one function there and call 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 `hypershift-operator/controllers/nodepool/capi.go:335` 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 (13 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:209 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:209-221 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:223-235 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/konnectivity/reconcile.go:237-249 — all 3 copies are in the same file, so extract the block into one function there and call 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.
AC4 · Keyboard semantics · Positive tabindex (1) · ×1
  • Positive tabindex (1) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:275 — A positive tabindex forces a manual tab order that fights the DOM and is fragile. Use tabindex="0" (or restructure the DOM).
AC4 · Keyboard semantics · Positive tabindex (2) · ×1
  • Positive tabindex (2) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:282 — A positive tabindex forces a manual tab order that fights the DOM and is fragile. Use tabindex="0" (or restructure the DOM).
AC4 · Keyboard semantics · Positive tabindex (3) · ×1
  • Positive tabindex (3) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/templates/login.html:285 — A positive tabindex forces a manual tab order that fights the DOM and is fragile. Use tabindex="0" (or restructure the DOM).
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcileLegacy (cyclomatic 336) · ×1
  • HostedClusterReconciler.reconcileLegacy (cyclomatic 336) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56 — HostedClusterReconciler.reconcileLegacy has cyclomatic complexity 336 (threshold 15). Of this number, 314 points are the body's own statements and 22 belong to 11 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.
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcile (cyclomatic 205) · ×1
  • HostedClusterReconciler.reconcile (cyclomatic 205) REDACTED:462 — HostedClusterReconciler.reconcile has cyclomatic complexity 205 (threshold 15). Of this number, 187 points are the body's own statements and 18 belong to 9 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.
D1 · Cyclomatic Complexity · HostedClusterReconciler.delete (cyclomatic 48) · ×1
  • HostedClusterReconciler.delete (cyclomatic 48) REDACTED:4119 — HostedClusterReconciler.delete has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PRReportGenerator.generate_blog_data (cyclomatic 41) · ×1
  • PRReportGenerator.generate_blog_data (cyclomatic 41) contrib/repo_metrics/weekly_pr_report.py:1541 — PRReportGenerator.generate_blog_data has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · e2eutilallowlist.run (cyclomatic 39) · ×1
  • e2eutilallowlist.run (cyclomatic 39) hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go:29 — e2eutilallowlist.run has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 6 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 43). 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.
D1 · Cyclomatic Complexity · platform.GetPlatform (cyclomatic 34) · ×1
  • platform.GetPlatform (cyclomatic 34) hypershift-operator/controllers/hostedcluster/internal/platform/platform.go:95 — platform.GetPlatform 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.reconcile (cyclomatic 34) · ×1
  • NodePoolReconciler.reconcile (cyclomatic 34) hypershift-operator/controllers/nodepool/nodepool_controller.go:313 — NodePoolReconciler.reconcile 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.
D1 · Cyclomatic Complexity · testfuncstructure.reportGroup (cyclomatic 32) · ×1
  • testfuncstructure.reportGroup (cyclomatic 32) hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go:633 — testfuncstructure.reportGroup has cyclomatic complexity 32 (threshold 15). Of this number, 25 points are the body's own statements and 7 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.
D1 · Cyclomatic Complexity · GCPPrivateServiceConnectReconciler.Reconcile (cyclomatic 30) · ×1
  • GCPPrivateServiceConnectReconciler.Reconcile (cyclomatic 30) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:184 — GCPPrivateServiceConnectReconciler.Reconcile 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.
D1 · Cyclomatic Complexity · reconciler.Reconcile (cyclomatic 30) · ×1
  • reconciler.Reconcile (cyclomatic 30) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:361 — reconciler.Reconcile has cyclomatic complexity 30 (threshold 15). 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, 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.
D1 · Cyclomatic Complexity · reconciler.reconcileRegistryAndIngress (cyclomatic 30) · ×1
  • reconciler.reconcileRegistryAndIngress (cyclomatic 30) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:664 — reconciler.reconcileRegistryAndIngress has cyclomatic complexity 30 (threshold 15). Of this number, 21 points are the body's own statements and 9 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.
D1 · Cyclomatic Complexity · main.generate (cyclomatic 30) · ×1
  • main.generate (cyclomatic 30) hack/gmp-api-gen/main.go:37 — main.generate has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · main.run (cyclomatic 30) · ×1
  • main.run (cyclomatic 30) hypershift-operator/main.go:270 — main.run has cyclomatic complexity 30 (threshold 15). 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, 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.
D1 · Cyclomatic Complexity · LocalIgnitionProvider.GetPayload (cyclomatic 30) · ×1
  • LocalIgnitionProvider.GetPayload (cyclomatic 30) REDACTED:687 — LocalIgnitionProvider.GetPayload has cyclomatic complexity 30 (threshold 15). 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, 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.
D1 · Cyclomatic Complexity · TokenSecretReconciler.Reconcile (cyclomatic 30) · ×1
  • TokenSecretReconciler.Reconcile (cyclomatic 30) ignition-server/controllers/tokensecret_controller.go:183 — TokenSecretReconciler.Reconcile has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PRReportGenerator.generate_report (cyclomatic 30) · ×1
  • PRReportGenerator.generate_report (cyclomatic 30) contrib/repo_metrics/weekly_pr_report.py:1064 — PRReportGenerator.generate_report 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.
D1 · Cyclomatic Complexity · generate_ownership.build_rules (cyclomatic 30) · ×1
  • generate_ownership.build_rules (cyclomatic 30) skills/restructure-commits/generate_ownership.py:225 — generate_ownership.build_rules 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.
D1 · Cyclomatic Complexity · CreateOptions.ApplyPlatformSpecifics (cyclomatic 29) · ×1
  • CreateOptions.ApplyPlatformSpecifics (cyclomatic 29) cmd/cluster/aws/create.go:231 — CreateOptions.ApplyPlatformSpecifics has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dump.DumpCluster (cyclomatic 29) · ×1
  • dump.DumpCluster (cyclomatic 29) REDACTED:444 — dump.DumpCluster has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AWSEndpointServiceReconciler.Reconcile (cyclomatic 29) · ×1
  • AWSEndpointServiceReconciler.Reconcile (cyclomatic 29) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:420 — AWSEndpointServiceReconciler.Reconcile has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.Reconcile (cyclomatic 29) · ×1
  • HostedControlPlaneReconciler.Reconcile (cyclomatic 29) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:741 — HostedControlPlaneReconciler.Reconcile has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reconciler.reconcileCloudCredentialSecrets (cyclomatic 29) · ×1
  • reconciler.reconcileCloudCredentialSecrets (cyclomatic 29) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1855 — reconciler.reconcileCloudCredentialSecrets has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · CertificateRevocationController.ensureOldSignerCertificateRevoked (cyclomatic 29) · ×1
  • CertificateRevocationController.ensureOldSignerCertificateRevoked (cyclomatic 29) REDACTED:998 — CertificateRevocationController.ensureOldSignerCertificateRevoked has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.crossFileCascade (cyclomatic 29) · ×1
  • main.crossFileCascade (cyclomatic 29) REDACTED:311 — main.crossFileCascade has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hostedcluster.enqueueHostedClustersFunc (cyclomatic 29) · ×1
  • hostedcluster.enqueueHostedClustersFunc (cyclomatic 29) REDACTED:4362 — hostedcluster.enqueueHostedClustersFunc has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to one function literal inside it that branches (line 4363). 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.
D1 · Cyclomatic Complexity · CAPI.Reconcile (cyclomatic 29) · ×1
  • CAPI.Reconcile (cyclomatic 29) hypershift-operator/controllers/nodepool/capi.go:89 — CAPI.Reconcile has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · capabilities.DetectManagementClusterCapabilities (cyclomatic 29) · ×1
  • capabilities.DetectManagementClusterCapabilities (cyclomatic 29) support/capabilities/management_cluster_capabilities.go:136 — capabilities.DetectManagementClusterCapabilities has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RBACManager.assignRole (cyclomatic 28) · ×1
  • RBACManager.assignRole (cyclomatic 28) cmd/infra/azure/rbac.go:247 — RBACManager.assignRole has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DestroyInfraOptions.DestroyInfra (cyclomatic 28) · ×1
  • DestroyInfraOptions.DestroyInfra (cyclomatic 28) cmd/infra/powervs/destroy.go:155 — DestroyInfraOptions.DestroyInfra has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AzurePrivateLinkServiceReconciler.Reconcile (cyclomatic 28) · ×1
  • AzurePrivateLinkServiceReconciler.Reconcile (cyclomatic 28) control-plane-operator/controllers/azureprivatelinkservice/controller.go:247 — AzurePrivateLinkServiceReconciler.Reconcile has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileCPOV2 (cyclomatic 28) · ×1
  • HostedControlPlaneReconciler.reconcileCPOV2 (cyclomatic 28) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1393 — HostedControlPlaneReconciler.reconcileCPOV2 has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kas.ReconcileService (cyclomatic 28) · ×1
  • kas.ReconcileService (cyclomatic 28) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:35 — kas.ReconcileService has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kas.generateConfig (cyclomatic 28) · ×1
  • kas.generateConfig (cyclomatic 28) control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go:98 — kas.generateConfig has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kas.adaptDeployment (cyclomatic 28) · ×1
  • kas.adaptDeployment (cyclomatic 28) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:69 — kas.adaptDeployment has cyclomatic complexity 28 (threshold 15). Of this number, 27 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.
D1 · Cyclomatic Complexity · DefragController.runDefrag (cyclomatic 28) · ×1
  • DefragController.runDefrag (cyclomatic 28) etcd-defrag/etcddefrag_controller.go:131 — DefragController.runDefrag has cyclomatic complexity 28 (threshold 15). Of this number, 26 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.
D1 · Cyclomatic Complexity · main.readFindings (cyclomatic 28) · ×1
  • main.readFindings (cyclomatic 28) hack/tools/deadcode-report/report.go:46 — main.readFindings has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · CreateOptions.ApplyPlatformSpecifics (cyclomatic 27) · ×1
  • CreateOptions.ApplyPlatformSpecifics (cyclomatic 27) cmd/cluster/azure/create.go:377 — CreateOptions.ApplyPlatformSpecifics has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateOptions.RunBackup (cyclomatic 27) · ×1
  • CreateOptions.RunBackup (cyclomatic 27) cmd/oadp/backup.go:87 — CreateOptions.RunBackup has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateOptions.RunSchedule (cyclomatic 27) · ×1
  • CreateOptions.RunSchedule (cyclomatic 27) cmd/oadp/schedule.go:113 — CreateOptions.RunSchedule has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcilePKI (cyclomatic 27) · ×1
  • HostedControlPlaneReconciler.reconcilePKI (cyclomatic 27) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2213 — HostedControlPlaneReconciler.reconcilePKI has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Reconciler.reconcileAPIServerService (cyclomatic 27) · ×1
  • Reconciler.reconcileAPIServerService (cyclomatic 27) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:211 — Reconciler.reconcileAPIServerService has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CertificateRevocationController.ensureNewSignerCertificatePropagated (cyclomatic 27) · ×1
  • CertificateRevocationController.ensureNewSignerCertificatePropagated (cyclomatic 27) REDACTED:705 — CertificateRevocationController.ensureNewSignerCertificatePropagated has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hostedcluster.reconcileHostedControlPlane (cyclomatic 27) · ×1
  • hostedcluster.reconcileHostedControlPlane (cyclomatic 27) REDACTED:3021 — hostedcluster.reconcileHostedControlPlane has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PRReportGenerator.fetch_release_prs_graphql (cyclomatic 27) · ×1
  • PRReportGenerator.fetch_release_prs_graphql (cyclomatic 27) contrib/repo_metrics/weekly_pr_report.py:616 — PRReportGenerator.fetch_release_prs_graphql has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · availabilityprober.check (cyclomatic 26) · ×1
  • availabilityprober.check (cyclomatic 26) REDACTED:112 — availabilityprober.check has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · core.CreateCluster (cyclomatic 26) · ×1
  • core.CreateCluster (cyclomatic 26) cmd/cluster/core/create.go:1104 — core.CreateCluster has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AWSEndpointServiceReconciler.delete (cyclomatic 26) · ×1
  • AWSEndpointServiceReconciler.delete (cyclomatic 26) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1303 — AWSEndpointServiceReconciler.delete has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.removeCloudResources (cyclomatic 26) · ×1
  • HostedControlPlaneReconciler.removeCloudResources (cyclomatic 26) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2943 — HostedControlPlaneReconciler.removeCloudResources has cyclomatic complexity 26 (threshold 15). Of this number, 22 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.
D1 · Cyclomatic Complexity · hostedcluster.validateSliceNetworkCIDRs (cyclomatic 26) · ×1
  • hostedcluster.validateSliceNetworkCIDRs (cyclomatic 26) REDACTED:5203 — hostedcluster.validateSliceNetworkCIDRs has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcilePublicEndpointExposedCondition (cyclomatic 26) · ×1
  • HostedClusterReconciler.reconcilePublicEndpointExposedCondition (cyclomatic 26) REDACTED:6340 — HostedClusterReconciler.reconcilePublicEndpointExposedCondition has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HAProxy.reconcileHAProxyIgnitionConfig (cyclomatic 26) · ×1
  • HAProxy.reconcileHAProxyIgnitionConfig (cyclomatic 26) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:103 — HAProxy.reconcileHAProxyIgnitionConfig has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · conditions.ExpectedHCConditions (cyclomatic 26) · ×1
  • conditions.ExpectedHCConditions (cyclomatic 26) support/conditions/conditions.go:12 — conditions.ExpectedHCConditions has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.NewStartCommand (cyclomatic 25) · ×1
  • main.NewStartCommand (cyclomatic 25) control-plane-operator/main.go:323 — main.NewStartCommand has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 367). 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.
D1 · Cyclomatic Complexity · main.processFile (cyclomatic 25) · ×1
  • main.processFile (cyclomatic 25) REDACTED:200 — main.processFile has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PowerVS.ReconcileCredentials (cyclomatic 25) · ×1
  • PowerVS.ReconcileCredentials (cyclomatic 25) hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:204 — PowerVS.ReconcileCredentials has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 226, 291, 327, …). 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.
D1 · Cyclomatic Complexity · kubevirt.virtualMachineTemplateBase (cyclomatic 25) · ×1
  • kubevirt.virtualMachineTemplateBase (cyclomatic 25) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:208 — kubevirt.virtualMachineTemplateBase has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · secretJanitor.Reconcile (cyclomatic 25) · ×1
  • secretJanitor.Reconcile (cyclomatic 25) hypershift-operator/controllers/nodepool/secret_janitor.go:35 — secretJanitor.Reconcile has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · globalconfig.ReconcileInfrastructure (cyclomatic 25) · ×1
  • globalconfig.ReconcileInfrastructure (cyclomatic 25) support/globalconfig/infrastructure.go:31 — globalconfig.ReconcileInfrastructure has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.run (cyclomatic 25) · ×1
  • main.run (cyclomatic 25) hack/tools/deadcode-report/main.go:47 — main.run has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · configrefs.oauthSecretRefs (cyclomatic 24) · ×1
  • configrefs.oauthSecretRefs (cyclomatic 24) api/util/configrefs/refs.go:124 — configrefs.oauthSecretRefs 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.
D1 · Cyclomatic Complexity · CreateOptions.GenerateNodePools (cyclomatic 24) · ×1
  • CreateOptions.GenerateNodePools (cyclomatic 24) cmd/cluster/azure/create.go:555 — CreateOptions.GenerateNodePools 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.
D1 · Cyclomatic Complexity · core.parseEtcdShard (cyclomatic 24) · ×1
  • core.parseEtcdShard (cyclomatic 24) cmd/cluster/core/etcd_shards.go:85 — core.parseEtcdShard 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.
D1 · Cyclomatic Complexity · install.InstallHyperShiftOperator (cyclomatic 24) · ×1
  • install.InstallHyperShiftOperator (cyclomatic 24) cmd/install/install.go:552 — install.InstallHyperShiftOperator 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.
D1 · Cyclomatic Complexity · reconciler.ensureCloudResourcesDestroyed (cyclomatic 24) · ×1
  • reconciler.ensureCloudResourcesDestroyed (cyclomatic 24) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2529 — reconciler.ensureCloudResourcesDestroyed 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.
D1 · Cyclomatic Complexity · main.main (cyclomatic 24) · ×1
  • main.main (cyclomatic 24) REDACTED:74 — main.main 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.
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings (cyclomatic 24) · ×1
  • HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings (cyclomatic 24) REDACTED:5761 — HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · validations.ValidateOCPAPIServerSANs (cyclomatic 24) · ×1
  • validations.ValidateOCPAPIServerSANs (cyclomatic 24) hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:28 — validations.ValidateOCPAPIServerSANs 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.
D1 · Cyclomatic Complexity · nodepool.isArchAndPlatformSupported (cyclomatic 24) · ×1
  • nodepool.isArchAndPlatformSupported (cyclomatic 24) hypershift-operator/controllers/nodepool/nodepool_controller.go:621 — nodepool.isArchAndPlatformSupported 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.
D1 · Cyclomatic Complexity · util.setHostedClusterSchedulingAnnotations (cyclomatic 24) · ×1
  • util.setHostedClusterSchedulingAnnotations (cyclomatic 24) hypershift-operator/controllers/scheduler/util/scheduler.go:21 — util.setHostedClusterSchedulingAnnotations has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · main.run (cyclomatic 24) · ×1
  • main.run (cyclomatic 24) karpenter-operator/main.go:86 — main.run has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · controlPlaneWorkload.setDefaultOptions (cyclomatic 24) · ×1
  • controlPlaneWorkload.setDefaultOptions (cyclomatic 24) support/controlplane-component/defaults.go:115 — controlPlaneWorkload.setDefaultOptions has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KonnectivityContainerOptions.buildContainer (cyclomatic 24) · ×1
  • KonnectivityContainerOptions.buildContainer (cyclomatic 24) support/controlplane-component/konnectivity-container.go:141 — KonnectivityContainerOptions.buildContainer 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.
D1 · Cyclomatic Complexity · ValidatedCreateOptions.Complete (cyclomatic 23) · ×1
  • ValidatedCreateOptions.Complete (cyclomatic 23) cmd/cluster/aws/create.go:113 — ValidatedCreateOptions.Complete 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.
D1 · Cyclomatic Complexity · core.destroyCluster (cyclomatic 23) · ×1
  • core.destroyCluster (cyclomatic 23) cmd/cluster/core/destroy.go:128 — core.destroyCluster 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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileDefaultSecurityGroup (cyclomatic 23) · ×1
  • HostedControlPlaneReconciler.reconcileDefaultSecurityGroup (cyclomatic 23) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3088 — HostedControlPlaneReconciler.reconcileDefaultSecurityGroup has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.setupKASClientSigners (cyclomatic 23) · ×1
  • HostedControlPlaneReconciler.setupKASClientSigners (cyclomatic 23) control-plane-operator/controllers/hostedcontrolplane/kas_pki_setup.go:19 — HostedControlPlaneReconciler.setupKASClientSigners has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.setCIDRConflictCondition (cyclomatic 23) · ×1
  • NodePoolReconciler.setCIDRConflictCondition (cyclomatic 23) hypershift-operator/controllers/nodepool/conditions.go:946 — NodePoolReconciler.setCIDRConflictCondition 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.
D1 · Cyclomatic Complexity · placeholderUpdater.reconcile (cyclomatic 23) · ×1
  • placeholderUpdater.reconcile (cyclomatic 23) hypershift-operator/controllers/scheduler/aws/placeholders.go:287 — placeholderUpdater.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.
D1 · Cyclomatic Complexity · EC2NodeClassReconciler.Reconcile (cyclomatic 23) · ×1
  • EC2NodeClassReconciler.Reconcile (cyclomatic 23) karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:118 — EC2NodeClassReconciler.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.
D1 · Cyclomatic Complexity · kubevirtexternalinfra.ValidateKubeConfig (cyclomatic 23) · ×1
  • kubevirtexternalinfra.ValidateKubeConfig (cyclomatic 23) kubevirtexternalinfra/externalinfra.go:318 — kubevirtexternalinfra.ValidateKubeConfig 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.
D1 · Cyclomatic Complexity · releaseinfo.readComponentVersions (cyclomatic 23) · ×1
  • releaseinfo.readComponentVersions (cyclomatic 23) support/releaseinfo/releaseinfo.go:149 — releaseinfo.readComponentVersions 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.
D1 · Cyclomatic Complexity · applyProvider.update (cyclomatic 23) · ×1
  • applyProvider.update (cyclomatic 23) support/upsert/apply.go:116 — applyProvider.update 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.
D1 · Cyclomatic Complexity · vacuouspass.extractNonEmptyGuardTarget (cyclomatic 23) · ×1
  • vacuouspass.extractNonEmptyGuardTarget (cyclomatic 23) hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:255 — vacuouspass.extractNonEmptyGuardTarget has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 265). 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.
D1 · Cyclomatic Complexity · RawCreateOptions.Validate (cyclomatic 22) · ×1
  • RawCreateOptions.Validate (cyclomatic 22) cmd/cluster/azure/create.go:169 — RawCreateOptions.Validate has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kas.deriveKMSKeys (cyclomatic 22) · ×1
  • kas.deriveKMSKeys (cyclomatic 22) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms.go:86 — kas.deriveKMSKeys has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kas.NewConfigParams (cyclomatic 22) · ×1
  • kas.NewConfigParams (cyclomatic 22) control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go:68 — kas.NewConfigParams has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reconciler.reconcileOLM (cyclomatic 22) · ×1
  • reconciler.reconcileOLM (cyclomatic 22) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2072 — reconciler.reconcileOLM has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · main.stripDecls (cyclomatic 22) · ×1
  • main.stripDecls (cyclomatic 22) REDACTED:658 — main.stripDecls has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SnapshotReconciler.Reconcile (cyclomatic 22) · ×1
  • SnapshotReconciler.Reconcile (cyclomatic 22) hypershift-operator/controllers/auditlogpersistence/snapshot_controller.go:141 — SnapshotReconciler.Reconcile has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AWSEndpointServiceReconciler.Reconcile (cyclomatic 22) · ×1
  • AWSEndpointServiceReconciler.Reconcile (cyclomatic 22) REDACTED:269 — AWSEndpointServiceReconciler.Reconcile has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KarpenterIgnitionReconciler.Reconcile (cyclomatic 22) · ×1
  • KarpenterIgnitionReconciler.Reconcile (cyclomatic 22) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:96 — KarpenterIgnitionReconciler.Reconcile has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CRDMigrator.Reconcile (cyclomatic 22) · ×1
  • CRDMigrator.Reconcile (cyclomatic 22) support/capi-crdmigrator/crd_migrator.go:163 — CRDMigrator.Reconcile 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.main (cyclomatic 22) · ×1
  • main.main (cyclomatic 22) hack/tools/release/notes.go:32 — main.main has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PRReportGenerator._write_section (cyclomatic 22) · ×1
  • PRReportGenerator._write_section (cyclomatic 22) contrib/repo_metrics/weekly_pr_report.py:1218 — PRReportGenerator._write_section has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · azure.newAPIJournalCollector (cyclomatic 21) · ×1
  • azure.newAPIJournalCollector (cyclomatic 21) cmd/consolelogs/azure/api_journals.go:60 — azure.newAPIJournalCollector has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateInfraOptions.handleIdentitiesAndRBAC (cyclomatic 21) · ×1
  • CreateInfraOptions.handleIdentitiesAndRBAC (cyclomatic 21) cmd/infra/azure/create.go:239 — CreateInfraOptions.handleIdentitiesAndRBAC 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.
D1 · Cyclomatic Complexity · install.setupAuth (cyclomatic 21) · ×1
  • install.setupAuth (cyclomatic 21) cmd/install/install.go:1713 — install.setupAuth 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.
D1 · Cyclomatic Complexity · CreateNodePoolOptions.CreateNodePool (cyclomatic 21) · ×1
  • CreateNodePoolOptions.CreateNodePool (cyclomatic 21) cmd/nodepool/core/create.go:99 — CreateNodePoolOptions.CreateNodePool has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · etcd.adaptStatefulSet (cyclomatic 21) · ×1
  • etcd.adaptStatefulSet (cyclomatic 21) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go:42 — etcd.adaptStatefulSet has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 3 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.
D1 · Cyclomatic Complexity · network.ReconcileNetworkOperator (cyclomatic 21) · ×1
  • network.ReconcileNetworkOperator (cyclomatic 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/network/reconcile.go:39 — network.ReconcileNetworkOperator 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.
D1 · Cyclomatic Complexity · reconciler.reconcileNetworkingAndSecrets (cyclomatic 21) · ×1
  • reconciler.reconcileNetworkingAndSecrets (cyclomatic 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:905 — reconciler.reconcileNetworkingAndSecrets has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · reconciler.reconcileMetricsForwarder (cyclomatic 21) · ×1
  • reconciler.reconcileMetricsForwarder (cyclomatic 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1040 — reconciler.reconcileMetricsForwarder has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reconciler.ensureIngressControllersRemoved (cyclomatic 21) · ×1
  • reconciler.ensureIngressControllersRemoved (cyclomatic 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2877 — reconciler.ensureIngressControllersRemoved 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.
D1 · Cyclomatic Complexity · main.localizeFile (cyclomatic 21) · ×1
  • main.localizeFile (cyclomatic 21) REDACTED:1316 — main.localizeFile 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.
D1 · Cyclomatic Complexity · supportedversion.IsValidReleaseVersion (cyclomatic 21) · ×1
  • supportedversion.IsValidReleaseVersion (cyclomatic 21) support/supportedversion/version.go:136 — supportedversion.IsValidReleaseVersion has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · commit_layout.cmd_verify (cyclomatic 21) · ×1
  • commit_layout.cmd_verify (cyclomatic 21) skills/restructure-commits/commit_layout.py:210 — commit_layout.cmd_verify 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.
D1 · Cyclomatic Complexity · DrOidcIamOptions.Run (cyclomatic 20) · ×1
  • DrOidcIamOptions.Run (cyclomatic 20) REDACTED:388 — DrOidcIamOptions.Run has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · install.crdIncludeFilter (cyclomatic 20) · ×1
  • install.crdIncludeFilter (cyclomatic 20) cmd/install/install.go:993 — install.crdIncludeFilter has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to one function literal inside it that branches (line 994). 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.
D1 · Cyclomatic Complexity · FirewallManager.Delete (cyclomatic 20) · ×1
  • FirewallManager.Delete (cyclomatic 20) control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:373 — FirewallManager.Delete 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.
D1 · Cyclomatic Complexity · Reconciler.reconcileInPlaceUpgrade (cyclomatic 20) · ×1
  • Reconciler.reconcileInPlaceUpgrade (cyclomatic 20) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:179 — Reconciler.reconcileInPlaceUpgrade 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 cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcileSecretEncryptionSync (cyclomatic 20) · ×1
  • HostedClusterReconciler.reconcileSecretEncryptionSync (cyclomatic 20) REDACTED:2121 — HostedClusterReconciler.reconcileSecretEncryptionSync has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 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.
D1 · Cyclomatic Complexity · Reconciler.Reconcile (cyclomatic 20) · ×1
  • Reconciler.Reconcile (cyclomatic 20) hypershift-operator/controllers/ignitionpayload/controller.go:105 — Reconciler.Reconcile 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.
D1 · Cyclomatic Complexity · nodepool.defaultAzureNodePoolImage (cyclomatic 20) · ×1
  • nodepool.defaultAzureNodePoolImage (cyclomatic 20) hypershift-operator/controllers/nodepool/azure.go:40 — nodepool.defaultAzureNodePoolImage has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · kubevirt.MachineTemplateSpec (cyclomatic 20) · ×1
  • kubevirt.MachineTemplateSpec (cyclomatic 20) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:434 — kubevirt.MachineTemplateSpec 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.
D1 · Cyclomatic Complexity · AzurePrivateLinkServiceController.reconcilePrivateLinkService (cyclomatic 20) · ×1
  • AzurePrivateLinkServiceController.reconcilePrivateLinkService (cyclomatic 20) hypershift-operator/controllers/platform/azure/controller.go:214 — AzurePrivateLinkServiceController.reconcilePrivateLinkService has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GCPLoadBalancerLabelsReconciler.reconcileRouterServices (cyclomatic 20) · ×1
  • GCPLoadBalancerLabelsReconciler.reconcileRouterServices (cyclomatic 20) hypershift-operator/controllers/platform/gcp/loadbalancer_labels_controller.go:226 — GCPLoadBalancerLabelsReconciler.reconcileRouterServices 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.
D1 · Cyclomatic Complexity · DedicatedServingComponentSchedulerAndSizer.Reconcile (cyclomatic 20) · ×1
  • DedicatedServingComponentSchedulerAndSizer.Reconcile (cyclomatic 20) REDACTED:431 — DedicatedServingComponentSchedulerAndSizer.Reconcile has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SharedIngressReconciler.reconcileRouter (cyclomatic 20) · ×1
  • SharedIngressReconciler.reconcileRouter (cyclomatic 20) hypershift-operator/controllers/sharedingress/sharedingress_controller.go:187 — SharedIngressReconciler.reconcileRouter 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.
D1 · Cyclomatic Complexity · main.main (cyclomatic 20) · ×1
  • main.main (cyclomatic 20) hack/tools/check-konflux-triggers/main.go:75 — main.main 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.
D1 · Cyclomatic Complexity · main.checkCRDsInDir (cyclomatic 20) · ×1
  • main.checkCRDsInDir (cyclomatic 20) hack/tools/crd-schema-check/main.go:131 — main.checkCRDsInDir 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.
D1 · Cyclomatic Complexity · testcasename.run (cyclomatic 20) · ×1
  • testcasename.run (cyclomatic 20) hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:23 — testcasename.run has cyclomatic complexity 20 (threshold 15). 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 30). 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.
D1 · Cyclomatic Complexity · PRReportGenerator.fetch_all_prs (cyclomatic 20) · ×1
  • PRReportGenerator.fetch_all_prs (cyclomatic 20) contrib/repo_metrics/weekly_pr_report.py:908 — PRReportGenerator.fetch_all_prs has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · powervs.getCISDomainDetails (cyclomatic 19) · ×1
  • powervs.getCISDomainDetails (cyclomatic 19) cmd/infra/powervs/create.go:479 — powervs.getCISDomainDetails has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 500). 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.
D1 · Cyclomatic Complexity · HyperShiftOperatorDeployment.buildEnvVars (cyclomatic 19) · ×1
  • HyperShiftOperatorDeployment.buildEnvVars (cyclomatic 19) cmd/install/assets/hypershift_operator.go:832 — HyperShiftOperatorDeployment.buildEnvVars has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileDeprecatedConfigurationStatus (cyclomatic 19) · ×1
  • HostedControlPlaneReconciler.reconcileDeprecatedConfigurationStatus (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:659 — HostedControlPlaneReconciler.reconcileDeprecatedConfigurationStatus has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.healthCheckKASLoadBalancers (cyclomatic 19) · ×1
  • HostedControlPlaneReconciler.healthCheckKASLoadBalancers (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1121 — HostedControlPlaneReconciler.healthCheckKASLoadBalancers 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.
D1 · Cyclomatic Complexity · ingress.ReconcileRouterService (cyclomatic 19) · ×1
  • ingress.ReconcileRouterService (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:24 — ingress.ReconcileRouterService 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.
D1 · Cyclomatic Complexity · kas.ReconcileServiceStatus (cyclomatic 19) · ×1
  • kas.ReconcileServiceStatus (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:183 — kas.ReconcileServiceStatus has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · kas.ReconcilePrivateService (cyclomatic 19) · ×1
  • kas.ReconcilePrivateService (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:228 — kas.ReconcilePrivateService 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.
D1 · Cyclomatic Complexity · azure.azureConfig (cyclomatic 19) · ×1
  • azure.azureConfig (cyclomatic 19) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/config.go:71 — azure.azureConfig 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.
D1 · Cyclomatic Complexity · Reconciler.reconcileGlobalPullSecret (cyclomatic 19) · ×1
  • Reconciler.reconcileGlobalPullSecret (cyclomatic 19) control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:71 — Reconciler.reconcileGlobalPullSecret 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.
D1 · Cyclomatic Complexity · ingress.NewIngressParams (cyclomatic 19) · ×1
  • ingress.NewIngressParams (cyclomatic 19) control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go:25 — ingress.NewIngressParams has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CertificateRevocationController.prunePreviousSignerCertificates (cyclomatic 19) · ×1
  • CertificateRevocationController.prunePreviousSignerCertificates (cyclomatic 19) REDACTED:870 — CertificateRevocationController.prunePreviousSignerCertificates 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.
D1 · Cyclomatic Complexity · nodepool.setScaleFromZeroAnnotationsOnObject (cyclomatic 19) · ×1
  • nodepool.setScaleFromZeroAnnotationsOnObject (cyclomatic 19) hypershift-operator/controllers/nodepool/scale_from_zero.go:74 — nodepool.setScaleFromZeroAnnotationsOnObject 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.Reconcile (cyclomatic 19) · ×1
  • NodePoolReconciler.Reconcile (cyclomatic 19) hypershift-operator/controllers/nodepool/nodepool_controller.go:208 — NodePoolReconciler.Reconcile has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Reconciler.SetupWithManager (cyclomatic 19) · ×1
  • Reconciler.SetupWithManager (cyclomatic 19) karpenter-operator/controllers/karpenter/karpenter_controller.go:77 — Reconciler.SetupWithManager has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 5 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.
D1 · Cyclomatic Complexity · upsert.defaultContainer (cyclomatic 19) · ×1
  • upsert.defaultContainer (cyclomatic 19) support/upsert/upsert.go:360 — upsert.defaultContainer 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.
D1 · Cyclomatic Complexity · tokenminter.mintToken (cyclomatic 19) · ×1
  • tokenminter.mintToken (cyclomatic 19) token-minter/tokenminter.go:119 — tokenminter.mintToken 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.
D1 · Cyclomatic Complexity · main.main (cyclomatic 19) · ×1
  • main.main (cyclomatic 19) hack/tools/deployment/deployment-update.go:87 — main.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · update_trusted_task_bundles.print_summary (cyclomatic 19) · ×1
  • update_trusted_task_bundles.print_summary (cyclomatic 19) hack/tools/scripts/update_trusted_task_bundles.py:437 — update_trusted_task_bundles.print_summary 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.
D1 · Cyclomatic Complexity · loader.Resolve (cyclomatic 18) · ×1
  • loader.Resolve (cyclomatic 18) contrib/gomaxprocs-webhook/internal/config/loader.go:45 — loader.Resolve 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.
D1 · Cyclomatic Complexity · core.forceRemoveAllFinalizers (cyclomatic 18) · ×1
  • core.forceRemoveAllFinalizers (cyclomatic 18) cmd/cluster/core/destroy.go:339 — core.forceRemoveAllFinalizers 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.
D1 · Cyclomatic Complexity · CreateInfraOptions.createPerZoneResources (cyclomatic 18) · ×1
  • CreateInfraOptions.createPerZoneResources (cyclomatic 18) cmd/infra/aws/create.go:322 — CreateInfraOptions.createPerZoneResources 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.
D1 · Cyclomatic Complexity · CreateIAMOptions.CreateIAM (cyclomatic 18) · ×1
  • CreateIAMOptions.CreateIAM (cyclomatic 18) cmd/infra/aws/create_iam.go:177 — CreateIAMOptions.CreateIAM 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.
D1 · Cyclomatic Complexity · DestroyIAMOptions.DestroyWorkerInstanceProfile (cyclomatic 18) · ×1
  • DestroyIAMOptions.DestroyWorkerInstanceProfile (cyclomatic 18) cmd/infra/aws/destroy_iam.go:284 — DestroyIAMOptions.DestroyWorkerInstanceProfile 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.
D1 · Cyclomatic Complexity · powervs.validateVpc (cyclomatic 18) · ×1
  • powervs.validateVpc (cyclomatic 18) cmd/infra/powervs/validate.go:107 — powervs.validateVpc has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · powervs.validateTransitGatewayByName (cyclomatic 18) · ×1
  • powervs.validateTransitGatewayByName (cyclomatic 18) cmd/infra/powervs/validate.go:167 — powervs.validateTransitGatewayByName has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 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.
D1 · Cyclomatic Complexity · Options.validateExternalDNSConfig (cyclomatic 18) · ×1
  • Options.validateExternalDNSConfig (cyclomatic 18) cmd/install/install.go:303 — Options.validateExternalDNSConfig 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.
D1 · Cyclomatic Complexity · RawKubevirtPlatformCreateOptions.Validate (cyclomatic 18) · ×1
  • RawKubevirtPlatformCreateOptions.Validate (cyclomatic 18) cmd/nodepool/kubevirt/create.go:96 — RawKubevirtPlatformCreateOptions.Validate 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.
D1 · Cyclomatic Complexity · AzurePrivateLinkServiceReconciler.reconcileDNSZone (cyclomatic 18) · ×1
  • AzurePrivateLinkServiceReconciler.reconcileDNSZone (cyclomatic 18) control-plane-operator/controllers/azureprivatelinkservice/controller.go:693 — AzurePrivateLinkServiceReconciler.reconcileDNSZone 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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileDeletion (cyclomatic 18) · ×1
  • HostedControlPlaneReconciler.reconcileDeletion (cyclomatic 18) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:436 — HostedControlPlaneReconciler.reconcileDeletion 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.
D1 · Cyclomatic Complexity · resources.Setup (cyclomatic 18) · ×1
  • resources.Setup (cyclomatic 18) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:183 — resources.Setup has cyclomatic complexity 18 (threshold 15). 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: 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.
D1 · Cyclomatic Complexity · etcdrecovery.checkEtcdStatus (cyclomatic 18) · ×1
  • etcdrecovery.checkEtcdStatus (cyclomatic 18) REDACTED:292 — etcdrecovery.checkEtcdStatus 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.
D1 · Cyclomatic Complexity · ConfigMapWebhookHandler.Handle (cyclomatic 18) · ×1
  • ConfigMapWebhookHandler.Handle (cyclomatic 18) hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:44 — ConfigMapWebhookHandler.Handle 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.
D1 · Cyclomatic Complexity · PodWebhookHandler.mutatePod (cyclomatic 18) · ×1
  • PodWebhookHandler.mutatePod (cyclomatic 18) hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:134 — PodWebhookHandler.mutatePod 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.
D1 · Cyclomatic Complexity · HCPEtcdBackupReconciler.Reconcile (cyclomatic 18) · ×1
  • HCPEtcdBackupReconciler.Reconcile (cyclomatic 18) hypershift-operator/controllers/etcdbackup/reconciler.go:311 — HCPEtcdBackupReconciler.Reconcile 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.
D1 · Cyclomatic Complexity · CAPI.listMachineTemplates (cyclomatic 18) · ×1
  • CAPI.listMachineTemplates (cyclomatic 18) hypershift-operator/controllers/nodepool/capi.go:1486 — CAPI.listMachineTemplates 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.setAllMachinesReadyCondition (cyclomatic 18) · ×1
  • NodePoolReconciler.setAllMachinesReadyCondition (cyclomatic 18) hypershift-operator/controllers/nodepool/conditions.go:783 — NodePoolReconciler.setAllMachinesReadyCondition 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.
D1 · Cyclomatic Complexity · uwmtelemetry.reconcileUWMConfigContent (cyclomatic 18) · ×1
  • uwmtelemetry.reconcileUWMConfigContent (cyclomatic 18) hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:206 — uwmtelemetry.reconcileUWMConfigContent 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.
D1 · Cyclomatic Complexity · main.setupNodePoolController (cyclomatic 18) · ×1
  • main.setupNodePoolController (cyclomatic 18) hypershift-operator/main.go:765 — main.setupNodePoolController 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.
D1 · Cyclomatic Complexity · hcpstatuspatch.advanceDefinitionsForStmt (cyclomatic 18) · ×1
  • hcpstatuspatch.advanceDefinitionsForStmt (cyclomatic 18) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:496 — hcpstatuspatch.advanceDefinitionsForStmt 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.
D1 · Cyclomatic Complexity · JiraClient._fetch_json (cyclomatic 18) · ×1
  • JiraClient._fetch_json (cyclomatic 18) contrib/repo_metrics/weekly_pr_report.py:87 — JiraClient._fetch_json 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.
D1 · Cyclomatic Complexity · update-job-registry.build_categories (cyclomatic 18) · ×1
  • update-job-registry.build_categories (cyclomatic 18) hack/ci/update-job-registry.py:180 — update-job-registry.build_categories 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.
D1 · Cyclomatic Complexity · update_trusted_task_bundles.main (cyclomatic 18) · ×1
  • update_trusted_task_bundles.main (cyclomatic 18) hack/tools/scripts/update_trusted_task_bundles.py:492 — update_trusted_task_bundles.main 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.
D1 · Cyclomatic Complexity · configrefs.oauthConfigMapRefs (cyclomatic 17) · ×1
  • configrefs.oauthConfigMapRefs (cyclomatic 17) api/util/configrefs/refs.go:183 — configrefs.oauthConfigMapRefs 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.
D1 · Cyclomatic Complexity · CreateBastionOpts.Run (cyclomatic 17) · ×1
  • CreateBastionOpts.Run (cyclomatic 17) cmd/bastion/aws/create.go:119 — CreateBastionOpts.Run 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.
D1 · Cyclomatic Complexity · core.parseTolerationString (cyclomatic 17) · ×1
  • core.parseTolerationString (cyclomatic 17) cmd/cluster/core/create.go:1368 — core.parseTolerationString has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · azure.collectMachineDiagnostics (cyclomatic 17) · ×1
  • azure.collectMachineDiagnostics (cyclomatic 17) cmd/consolelogs/azure/getlogs.go:141 — azure.collectMachineDiagnostics has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreateIAMOptions.CreateWorkerInstanceProfile (cyclomatic 17) · ×1
  • CreateIAMOptions.CreateWorkerInstanceProfile (cyclomatic 17) cmd/infra/aws/iam.go:1125 — CreateIAMOptions.CreateWorkerInstanceProfile 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.
D1 · Cyclomatic Complexity · azure.convergePrivateDNSZoneLink (cyclomatic 17) · ×1
  • azure.convergePrivateDNSZoneLink (cyclomatic 17) cmd/infra/azure/networking.go:569 — azure.convergePrivateDNSZoneLink has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 579). 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.
D1 · Cyclomatic Complexity · gcp.isTransientNetworkError (cyclomatic 17) · ×1
  • gcp.isTransientNetworkError (cyclomatic 17) REDACTED:772 — gcp.isTransientNetworkError has cyclomatic complexity 17 (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.
D1 · Cyclomatic Complexity · install.WaitUntilAvailable (cyclomatic 17) · ×1
  • install.WaitUntilAvailable (cyclomatic 17) cmd/install/install.go:745 — install.WaitUntilAvailable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 757, 792). 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.
D1 · Cyclomatic Complexity · install.hyperShiftOperatorManifests (cyclomatic 17) · ×1
  • install.hyperShiftOperatorManifests (cyclomatic 17) cmd/install/install.go:855 — install.hyperShiftOperatorManifests has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileNetworkServingCerts (cyclomatic 17) · ×1
  • HostedControlPlaneReconciler.reconcileNetworkServingCerts (cyclomatic 17) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1973 — HostedControlPlaneReconciler.reconcileNetworkServingCerts 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.
D1 · Cyclomatic Complexity · kas.ReconcileKonnectivityServerServiceStatus (cyclomatic 17) · ×1
  • kas.ReconcileKonnectivityServerServiceStatus (cyclomatic 17) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:421 — kas.ReconcileKonnectivityServerServiceStatus 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.
D1 · Cyclomatic Complexity · kas.deriveAESCBCEncryptionConfig (cyclomatic 17) · ×1
  • kas.deriveAESCBCEncryptionConfig (cyclomatic 17) control-plane-operator/controllers/hostedcontrolplane/v2/kas/secretencryption.go:119 — kas.deriveAESCBCEncryptionConfig 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.
D1 · Cyclomatic Complexity · reconciler.reconcileKubevirtPassthroughService (cyclomatic 17) · ×1
  • reconciler.reconcileKubevirtPassthroughService (cyclomatic 17) control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:97 — reconciler.reconcileKubevirtPassthroughService 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.
D1 · Cyclomatic Complexity · configuration.ReconcileGlobal (cyclomatic 17) · ×1
  • configuration.ReconcileGlobal (cyclomatic 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/configuration/global.go:18 — configuration.ReconcileGlobal has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reconciler.reconcileIngressController (cyclomatic 17) · ×1
  • reconciler.reconcileIngressController (cyclomatic 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1148 — reconciler.reconcileIngressController 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.
D1 · Cyclomatic Complexity · main.cascadeRemovals (cyclomatic 17) · ×1
  • main.cascadeRemovals (cyclomatic 17) REDACTED:520 — main.cascadeRemovals 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.
D1 · Cyclomatic Complexity · main.loadCAPIPackage (cyclomatic 17) · ×1
  • main.loadCAPIPackage (cyclomatic 17) REDACTED:1105 — main.loadCAPIPackage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PodWebhookHandler.Handle (cyclomatic 17) · ×1
  • PodWebhookHandler.Handle (cyclomatic 17) hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:50 — PodWebhookHandler.Handle 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.
D1 · Cyclomatic Complexity · HostedClusterReconciler.reconcileAutoNodeEnabledCondition (cyclomatic 17) · ×1
  • HostedClusterReconciler.reconcileAutoNodeEnabledCondition (cyclomatic 17) hypershift-operator/controllers/hostedcluster/karpenter.go:180 — HostedClusterReconciler.reconcileAutoNodeEnabledCondition 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.
D1 · Cyclomatic Complexity · AWS.CAPIProviderDeploymentSpec (cyclomatic 17) · ×1
  • AWS.CAPIProviderDeploymentSpec (cyclomatic 17) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:105 — AWS.CAPIProviderDeploymentSpec 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.reconcileScaleFromZeroAnnotations (cyclomatic 17) · ×1
  • NodePoolReconciler.reconcileScaleFromZeroAnnotations (cyclomatic 17) hypershift-operator/controllers/nodepool/nodepool_controller.go:1550 — NodePoolReconciler.reconcileScaleFromZeroAnnotations 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.reconcileMirroredConfigs (cyclomatic 17) · ×1
  • NodePoolReconciler.reconcileMirroredConfigs (cyclomatic 17) hypershift-operator/controllers/nodepool/nto.go:53 — NodePoolReconciler.reconcileMirroredConfigs 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.
D1 · Cyclomatic Complexity · NodePoolReconciler.ntoReconcile (cyclomatic 17) · ×1
  • NodePoolReconciler.ntoReconcile (cyclomatic 17) hypershift-operator/controllers/nodepool/nto.go:494 — NodePoolReconciler.ntoReconcile 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.
D1 · Cyclomatic Complexity · Token.cleanupOutdated (cyclomatic 17) · ×1
  • Token.cleanupOutdated (cyclomatic 17) hypershift-operator/controllers/nodepool/token.go:243 — Token.cleanupOutdated 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.
D1 · Cyclomatic Complexity · Token.resolveEffectiveHash (cyclomatic 17) · ×1
  • Token.resolveEffectiveHash (cyclomatic 17) hypershift-operator/controllers/nodepool/token.go:430 — Token.resolveEffectiveHash has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MachineSetDescaler.Reconcile (cyclomatic 17) · ×1
  • MachineSetDescaler.Reconcile (cyclomatic 17) hypershift-operator/controllers/scheduler/aws/autoscaler.go:139 — MachineSetDescaler.Reconcile 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.
D1 · Cyclomatic Complexity · Reconciler.reconcileDeletion (cyclomatic 17) · ×1
  • Reconciler.reconcileDeletion (cyclomatic 17) karpenter-operator/controllers/karpenter/karpenter_controller.go:440 — Reconciler.reconcileDeletion 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.
D1 · Cyclomatic Complexity · azureutil.GetKeyVaultDNSSuffix (cyclomatic 17) · ×1
  • azureutil.GetKeyVaultDNSSuffix (cyclomatic 17) support/azureutil/azureutil.go:414 — azureutil.GetKeyVaultDNSSuffix 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.
D1 · Cyclomatic Complexity · catalogs.computeCatalogImages (cyclomatic 17) · ×1
  • catalogs.computeCatalogImages (cyclomatic 17) support/catalogs/images.go:125 — catalogs.computeCatalogImages 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.
D1 · Cyclomatic Complexity · controlPlaneWorkload.update (cyclomatic 17) · ×1
  • controlPlaneWorkload.update (cyclomatic 17) support/controlplane-component/controlplane-component.go:305 — controlPlaneWorkload.update has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · Options.Validate (cyclomatic 17) · ×1
  • Options.Validate (cyclomatic 17) support/konnectivityproxy/dialer.go:109 — Options.Validate 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.
D1 · Cyclomatic Complexity · proxyResolver.Resolve (cyclomatic 17) · ×1
  • proxyResolver.Resolve (cyclomatic 17) support/konnectivityproxy/resolver.go:110 — proxyResolver.Resolve 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.
D1 · Cyclomatic Complexity · registryclient.ExtractImageFiles (cyclomatic 17) · ×1
  • registryclient.ExtractImageFiles (cyclomatic 17) REDACTED:50 — registryclient.ExtractImageFiles has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 67). 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.
D1 · Cyclomatic Complexity · supportedversion.retrieveSupportedOCPVersion (cyclomatic 17) · ×1
  • supportedversion.retrieveSupportedOCPVersion (cyclomatic 17) support/supportedversion/version.go:482 — supportedversion.retrieveSupportedOCPVersion 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.
D1 · Cyclomatic Complexity · ho_release_gate.poll_until_complete (cyclomatic 17) · ×1
  • ho_release_gate.poll_until_complete (cyclomatic 17) .tekton/lib/ho_release_gate.py:194 — ho_release_gate.poll_until_complete 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.
D1 · Cyclomatic Complexity · verify-tekton-pipeline-pairs.check_pair (cyclomatic 17) · ×1
  • verify-tekton-pipeline-pairs.check_pair (cyclomatic 17) hack/verify-tekton-pipeline-pairs.py:195 — verify-tekton-pipeline-pairs.check_pair 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.
D1 · Cyclomatic Complexity · aws.ensureBastionSecurityGroup (cyclomatic 16) · ×1
  • aws.ensureBastionSecurityGroup (cyclomatic 16) cmd/bastion/aws/create.go:213 — aws.ensureBastionSecurityGroup 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.
D1 · Cyclomatic Complexity · azure.collectSerialConsoleLog (cyclomatic 16) · ×1
  • azure.collectSerialConsoleLog (cyclomatic 16) cmd/consolelogs/azure/getlogs.go:217 — azure.collectSerialConsoleLog has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · azure.parseAzureVMResourceID (cyclomatic 16) · ×1
  • azure.parseAzureVMResourceID (cyclomatic 16) cmd/consolelogs/azure/getlogs.go:291 — azure.parseAzureVMResourceID has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DrOidcIamOptions.extractFromHostedCluster (cyclomatic 16) · ×1
  • DrOidcIamOptions.extractFromHostedCluster (cyclomatic 16) REDACTED:269 — DrOidcIamOptions.extractFromHostedCluster has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CreateIAMOptions.CreateOIDCResources (cyclomatic 16) · ×1
  • CreateIAMOptions.CreateOIDCResources (cyclomatic 16) cmd/infra/aws/iam.go:859 — CreateIAMOptions.CreateOIDCResources 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.
D1 · Cyclomatic Complexity · azure.assessVirtualNetworkLinkStates (cyclomatic 16) · ×1
  • azure.assessVirtualNetworkLinkStates (cyclomatic 16) cmd/infra/azure/networking.go:396 — azure.assessVirtualNetworkLinkStates 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.
D1 · Cyclomatic Complexity · DestroyInfraOptions.Run (cyclomatic 16) · ×1
  • DestroyInfraOptions.Run (cyclomatic 16) cmd/infra/azure/destroy.go:111 — DestroyInfraOptions.Run 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.
D1 · Cyclomatic Complexity · DestroyInfraOptions.deleteClusterResourcesInGroup (cyclomatic 16) · ×1
  • DestroyInfraOptions.deleteClusterResourcesInGroup (cyclomatic 16) cmd/infra/azure/destroy.go:207 — DestroyInfraOptions.deleteClusterResourcesInGroup 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.
D1 · Cyclomatic Complexity · install.RenderHyperShiftOperator (cyclomatic 16) · ×1
  • install.RenderHyperShiftOperator (cyclomatic 16) cmd/install/install_render.go:115 — install.RenderHyperShiftOperator 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.
D1 · Cyclomatic Complexity · CompletedKubevirtPlatformCreateOptions.NodePoolPlatform (cyclomatic 16) · ×1
  • CompletedKubevirtPlatformCreateOptions.NodePoolPlatform (cyclomatic 16) cmd/nodepool/kubevirt/create.go:277 — CompletedKubevirtPlatformCreateOptions.NodePoolPlatform has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GCPPrivateServiceConnectReconciler.ensureIPAddress (cyclomatic 16) · ×1
  • GCPPrivateServiceConnectReconciler.ensureIPAddress (cyclomatic 16) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:641 — GCPPrivateServiceConnectReconciler.ensureIPAddress 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.
D1 · Cyclomatic Complexity · HostedControlPlaneReconciler.reconcileAzurePlatformCerts (cyclomatic 16) · ×1
  • HostedControlPlaneReconciler.reconcileAzurePlatformCerts (cyclomatic 16) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2136 — HostedControlPlaneReconciler.reconcileAzurePlatformCerts 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.
D1 · Cyclomatic Complexity · Reconciler.ReconcileInfrastructureStatus (cyclomatic 16) · ×1
  • Reconciler.ReconcileInfrastructureStatus (cyclomatic 16) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:115 — Reconciler.ReconcileInfrastructureStatus has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Reconciler.reconcileAPIServerServiceStatus (cyclomatic 16) · ×1
  • Reconciler.reconcileAPIServerServiceStatus (cyclomatic 16) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:519 — Reconciler.reconcileAPIServerServiceStatus has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · oauth.ReconcileService (cyclomatic 16) · ×1
  • oauth.ReconcileService (cyclomatic 16) control-plane-operator/controllers/hostedcontrolplane/oauth/service.go:30 — oauth.ReconcileService 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.
D1 · Cyclomatic Complexity · oauth.adaptDeployment (cyclomatic 16) · ×1
  • oauth.adaptDeployment (cyclomatic 16) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:36 — oauth.adaptDeployment has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedClusterConfigOperator.Run (cyclomatic 16) · ×1
  • HostedClusterConfigOperator.Run (cyclomatic 16) control-plane-operator/hostedclusterconfigoperator/cmd.go:223 — HostedClusterConfigOperator.Run has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · machine.Setup (cyclomatic 16) · ×1
  • machine.Setup (cyclomatic 16) control-plane-operator/hostedclusterconfigoperator/controllers/machine/setup.go:43 — machine.Setup has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
D1 · Cyclomatic Complexity · ProxyHandler.ServeHTTP (cyclomatic 16) · ×1
  • ProxyHandler.ServeHTTP (cyclomatic 16) control-plane-operator/metrics-proxy/proxy.go:36 — ProxyHandler.ServeHTTP 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.
D1 · Cyclomatic Complexity · CertificateRevocationController.generateNewSignerCertificate (cyclomatic 16) · ×1
  • CertificateRevocationController.generateNewSignerCertificate (cyclomatic 16) REDACTED:473 — CertificateRevocationController.generateNewSignerCertificate 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.
D1 · Cyclomatic Complexity · main.computeClosure (cyclomatic 16) · ×1
  • main.computeClosure (cyclomatic 16) REDACTED:957 — main.computeClosure has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
D1 · Cyclomatic Complexity · HostedClusterReconciler.validateConfigAndClusterCapabilities (cyclomatic 16) · ×1
  • HostedClusterReconciler.validateConfigAndClusterCapabilities (cyclomatic 16) REDACTED:4506 — HostedClusterReconciler.validateConfigAndClusterCapabilities has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenStack.CAPIProviderDeploymentSpec (cyclomatic 16) · ×1
  • OpenStack.CAPIProviderDeploymentSpec (cyclomatic 16) hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:186 — OpenStack.CAPIProviderDeploymentSpec has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NodePoolReconciler.setKubevirtConditions (cyclomatic 16) · ×1
  • NodePoolReconciler.setKubevirtConditions (cyclomatic 16) hypershift-operator/controllers/nodepool/kubevirt.go:35 — NodePoolReconciler.setKubevirtConditions has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NodePoolReconciler.enqueueNodePoolsForConfig (cyclomatic 16) · ×1
  • NodePoolReconciler.enqueueNodePoolsForConfig (cyclomatic 16) hypershift-operator/controllers/nodepool/nodepool_controller.go:1124 — NodePoolReconciler.enqueueNodePoolsForConfig 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.
D1 · Cyclomatic Complexity · placeholderCreator.reconcile (cyclomatic 16) · ×1
  • placeholderCreator.reconcile (cyclomatic 16) hypershift-operator/controllers/scheduler/aws/placeholders.go:179 — placeholderCreator.reconcile 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.
D1 · Cyclomatic Complexity · cmd.run (cyclomatic 16) · ×1
  • cmd.run (cyclomatic 16) REDACTED:216 — cmd.run has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 246, 235, 324). 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.
D1 · Cyclomatic Complexity · LocalIgnitionProvider.extractMCOBinaries (cyclomatic 16) · ×1
  • LocalIgnitionProvider.extractMCOBinaries (cyclomatic 16) REDACTED:1009 — LocalIgnitionProvider.extractMCOBinaries 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.
D1 · Cyclomatic Complexity · sharedingressconfiggenerator.getBackendsForHostedCluster (cyclomatic 16) · ×1
  • sharedingressconfiggenerator.getBackendsForHostedCluster (cyclomatic 16) sharedingress-config-generator/config.go:111 — sharedingressconfiggenerator.getBackendsForHostedCluster 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.
D1 · Cyclomatic Complexity · CRDMigrator.reconcileCleanupManagedFields (cyclomatic 16) · ×1
  • CRDMigrator.reconcileCleanupManagedFields (cyclomatic 16) support/capi-crdmigrator/crd_migrator.go:397 — CRDMigrator.reconcileCleanupManagedFields has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 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.
D1 · Cyclomatic Complexity · genericAdapter.reconcile (cyclomatic 16) · ×1
  • genericAdapter.reconcile (cyclomatic 16) support/controlplane-component/generic-adapter.go:62 — genericAdapter.reconcile 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.
D1 · Cyclomatic Complexity · gcputil.ReconcileLBResourceLabelAnnotations (cyclomatic 16) · ×1
  • gcputil.ReconcileLBResourceLabelAnnotations (cyclomatic 16) support/gcputil/gcputil.go:155 — gcputil.ReconcileLBResourceLabelAnnotations has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · registryclient.ExtractImageFilesToDir (cyclomatic 16) · ×1
  • registryclient.ExtractImageFilesToDir (cyclomatic 16) REDACTED:180 — registryclient.ExtractImageFilesToDir has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). 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.
D1 · Cyclomatic Complexity · secretencryption.FindKeyRole (cyclomatic 16) · ×1
  • secretencryption.FindKeyRole (cyclomatic 16) support/secretencryption/encryptionconfig.go:135 — secretencryption.FindKeyRole 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.
D1 · Cyclomatic Complexity · main.sourcePath (cyclomatic 16) · ×1
  • main.sourcePath (cyclomatic 16) hack/tools/deadcode-report/report.go:114 — main.sourcePath has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · JiraClient._parse_issue (cyclomatic 16) · ×1
  • JiraClient._parse_issue (cyclomatic 16) contrib/repo_metrics/weekly_pr_report.py:182 — JiraClient._parse_issue has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D12 · Dependency Hygiene · No go.sum committed (hack/tools/deadcode-report/testdata/reachability/REDACTED) · ×1
  • No go.sum committed (hack/tools/deadcode-report/testdata/reachability/REDACTED) — hack/tools/deadcode-report/testdata/reachability/REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 24 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 24 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 22 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 24 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 24 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 24 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 22 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D17 · Explicit Debt · XxxComment · ×1
  • XxxComment support/config/cipher_test.go:184 — // XXX unknown ciphers are filtered out — 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.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileLegacy (cognitive 621) · ×1
  • HostedClusterReconciler.reconcileLegacy (cognitive 621) hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56 — HostedClusterReconciler.reconcileLegacy has cognitive complexity 621 (threshold 15). Drivers by points: if/else 310 (573 pts), boolean chains 30, loops 8 (14 pts), match/switch 3 (4 pts) (nesting depth added 270). Of this number, 578 points are the body's own statements and 43 belong to 11 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.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcile (cognitive 365) · ×1
  • HostedClusterReconciler.reconcile (cognitive 365) REDACTED:462 — HostedClusterReconciler.reconcile has cognitive complexity 365 (threshold 15). Drivers by points: if/else 196 (335 pts), boolean chains 21, loops 5 (8 pts), match/switch 1 (nesting depth added 142). Of this number, 341 points are the body's own statements and 24 belong to 9 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.
D2 · Cognitive Complexity · main.crossFileCascade (cognitive 94) · ×1
  • main.crossFileCascade (cognitive 94) REDACTED:311 — main.crossFileCascade has cognitive complexity 94 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 10 (35 pts), match/switch 2 (11 pts), boolean chains 1 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · e2eutilallowlist.run (cognitive 94) · ×1
  • e2eutilallowlist.run (cognitive 94) hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/e2eutilallowlist.go:29 — e2eutilallowlist.run has cognitive complexity 94 (threshold 15). Drivers by points: if/else 24 (78 pts), loops 4 (9 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 60). Most of this is not in the body itself: 12 of the 94 points are its own statements and the rest belongs to one function literal inside it that branches (line 43). 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.
D2 · Cognitive Complexity · HostedClusterReconciler.delete (cognitive 81) · ×1
  • HostedClusterReconciler.delete (cognitive 81) REDACTED:4119 — HostedClusterReconciler.delete has cognitive complexity 81 (threshold 15). Drivers by points: if/else 46 (78 pts), boolean chains 3 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.reconcileRegistryAndIngress (cognitive 75) · ×1
  • reconciler.reconcileRegistryAndIngress (cognitive 75) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:664 — reconciler.reconcileRegistryAndIngress has cognitive complexity 75 (threshold 15). Drivers by points: if/else 28 (70 pts), boolean chains 5 (nesting depth added 42). Of this number, 40 points are the body's own statements and 35 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CreateOptions.RunBackup (cognitive 74) · ×1
  • CreateOptions.RunBackup (cognitive 74) cmd/oadp/backup.go:87 — CreateOptions.RunBackup has cognitive complexity 74 (threshold 15). Drivers by points: if/else 32 (73 pts), boolean chains 1 (nesting depth added 41). 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.
D2 · Cognitive Complexity · CreateOptions.RunSchedule (cognitive 73) · ×1
  • CreateOptions.RunSchedule (cognitive 73) cmd/oadp/schedule.go:113 — CreateOptions.RunSchedule has cognitive complexity 73 (threshold 15). Drivers by points: if/else 32 (72 pts), boolean chains 1 (nesting depth added 40). 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.
D2 · Cognitive Complexity · PRReportGenerator.generate_blog_data (cognitive 67) · ×1
  • PRReportGenerator.generate_blog_data (cognitive 67) contrib/repo_metrics/weekly_pr_report.py:1541 — PRReportGenerator.generate_blog_data has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (42 pts), loops 12 (15 pts), boolean chains 4, error handling 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · availabilityprober.check (cognitive 63) · ×1
  • availabilityprober.check (cognitive 63) REDACTED:112 — availabilityprober.check has cognitive complexity 63 (threshold 15). Drivers by points: if/else 18 (51 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · platform.GetPlatform (cognitive 61) · ×1
  • platform.GetPlatform (cognitive 61) hypershift-operator/controllers/hostedcluster/internal/platform/platform.go:95 — platform.GetPlatform has cognitive complexity 61 (threshold 15). Drivers by points: if/else 21 (57 pts), boolean chains 3, match/switch 1 (nesting depth added 36). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PRReportGenerator._write_section (cognitive 61) · ×1
  • PRReportGenerator._write_section (cognitive 61) contrib/repo_metrics/weekly_pr_report.py:1218 — PRReportGenerator._write_section has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (46 pts), ternaries 3 (9 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.delete (cognitive 59) · ×1
  • AWSEndpointServiceReconciler.delete (cognitive 59) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1303 — AWSEndpointServiceReconciler.delete has cognitive complexity 59 (threshold 15). Drivers by points: if/else 23 (52 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 31). 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.
D2 · Cognitive Complexity · hostedcluster.enqueueHostedClustersFunc (cognitive 56) · ×1
  • hostedcluster.enqueueHostedClustersFunc (cognitive 56) REDACTED:4362 — hostedcluster.enqueueHostedClustersFunc has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (44 pts), loops 3 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 33). None of this is in the body itself: all 56 points belong to one function literal inside it that branches (line 4363). 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.
D2 · Cognitive Complexity · reconciler.reconcileCloudCredentialSecrets (cognitive 54) · ×1
  • reconciler.reconcileCloudCredentialSecrets (cognitive 54) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1855 — reconciler.reconcileCloudCredentialSecrets has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (51 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 30). Of this number, 41 points are the body's own statements and 13 belong to 2 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.generate (cognitive 53) · ×1
  • main.generate (cognitive 53) hack/gmp-api-gen/main.go:37 — main.generate has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 7 (11 pts), boolean chains 3 (nesting depth added 24). Of this number, 50 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.
D2 · Cognitive Complexity · CAPI.Reconcile (cognitive 53) · ×1
  • CAPI.Reconcile (cognitive 53) hypershift-operator/controllers/nodepool/capi.go:89 — CAPI.Reconcile has cognitive complexity 53 (threshold 15). Drivers by points: if/else 31 (48 pts), boolean chains 5 (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.
D2 · Cognitive Complexity · TokenSecretReconciler.Reconcile (cognitive 52) · ×1
  • TokenSecretReconciler.Reconcile (cognitive 52) ignition-server/controllers/tokensecret_controller.go:183 — TokenSecretReconciler.Reconcile has cognitive complexity 52 (threshold 15). Drivers by points: if/else 30 (49 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 20). Of this number, 51 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.
D2 · Cognitive Complexity · update-job-registry.build_categories (cognitive 52) · ×1
  • update-job-registry.build_categories (cognitive 52) hack/ci/update-job-registry.py:180 — update-job-registry.build_categories has cognitive complexity 52 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 6 (16 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.cascadeRemovals (cognitive 51) · ×1
  • main.cascadeRemovals (cognitive 51) REDACTED:520 — main.cascadeRemovals has cognitive complexity 51 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 4 (15 pts), match/switch 2 (9 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GCPLoadBalancerLabelsReconciler.reconcileRouterServices (cognitive 51) · ×1
  • GCPLoadBalancerLabelsReconciler.reconcileRouterServices (cognitive 51) hypershift-operator/controllers/platform/gcp/loadbalancer_labels_controller.go:226 — GCPLoadBalancerLabelsReconciler.reconcileRouterServices has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (47 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.destroyCluster (cognitive 50) · ×1
  • core.destroyCluster (cognitive 50) cmd/cluster/core/destroy.go:128 — core.destroyCluster has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (49 pts), boolean chains 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PRReportGenerator.fetch_release_prs_graphql (cognitive 50) · ×1
  • PRReportGenerator.fetch_release_prs_graphql (cognitive 50) contrib/repo_metrics/weekly_pr_report.py:616 — PRReportGenerator.fetch_release_prs_graphql has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 5 (8 pts), ternaries 4 (7 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodePoolReconciler.setCIDRConflictCondition (cognitive 48) · ×1
  • NodePoolReconciler.setCIDRConflictCondition (cognitive 48) hypershift-operator/controllers/nodepool/conditions.go:946 — NodePoolReconciler.setCIDRConflictCondition has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 6 (12 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · testcasename.run (cognitive 48) · ×1
  • testcasename.run (cognitive 48) hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:23 — testcasename.run has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 29). Most of this is not in the body itself: 3 of the 48 points are its own statements and the rest belongs to one function literal inside it that branches (line 30). 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.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.Reconcile (cognitive 46) · ×1
  • GCPPrivateServiceConnectReconciler.Reconcile (cognitive 46) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:184 — GCPPrivateServiceConnectReconciler.Reconcile has cognitive complexity 46 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.reconcileAuthOIDC (cognitive 46) · ×1
  • reconciler.reconcileAuthOIDC (cognitive 46) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1263 — reconciler.reconcileAuthOIDC has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (41 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 31). Of this number, 37 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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.
D2 · Cognitive Complexity · reconciler.reconcileOLM (cognitive 46) · ×1
  • reconciler.reconcileOLM (cognitive 46) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2072 — reconciler.reconcileOLM has cognitive complexity 46 (threshold 15). Drivers by points: if/else 26 (44 pts), boolean chains 1, loops 1 (nesting depth added 18). Of this number, 38 points are the body's own statements and 8 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.
D2 · Cognitive Complexity · NodePoolReconciler.reconcile (cognitive 46) · ×1
  • NodePoolReconciler.reconcile (cognitive 46) hypershift-operator/controllers/nodepool/nodepool_controller.go:313 — NodePoolReconciler.reconcile has cognitive complexity 46 (threshold 15). Drivers by points: if/else 33 (45 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.
D2 · Cognitive Complexity · testfuncstructure.reportGroup (cognitive 46) · ×1
  • testfuncstructure.reportGroup (cognitive 46) hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go:633 — testfuncstructure.reportGroup has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (34 pts), boolean chains 5, loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 18). Of this number, 36 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · CreateOptions.ApplyPlatformSpecifics (cognitive 45) · ×1
  • CreateOptions.ApplyPlatformSpecifics (cognitive 45) cmd/cluster/azure/create.go:377 — CreateOptions.ApplyPlatformSpecifics has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 3 (5 pts), boolean chains 4, match/switch 1 (3 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.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.Reconcile (cognitive 45) · ×1
  • AWSEndpointServiceReconciler.Reconcile (cognitive 45) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:420 — AWSEndpointServiceReconciler.Reconcile has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (44 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reconciler.reconcileAPIServerService (cognitive 45) · ×1
  • Reconciler.reconcileAPIServerService (cognitive 45) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:211 — Reconciler.reconcileAPIServerService has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · kas.ReconcileService (cognitive 45) · ×1
  • kas.ReconcileService (cognitive 45) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:35 — kas.ReconcileService has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 8, loops 2 (4 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kubevirt.virtualMachineTemplateBase (cognitive 45) · ×1
  • kubevirt.virtualMachineTemplateBase (cognitive 45) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:208 — kubevirt.virtualMachineTemplateBase has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 3 (8 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · NodePoolReconciler.setAllMachinesReadyCondition (cognitive 45) · ×1
  • NodePoolReconciler.setAllMachinesReadyCondition (cognitive 45) hypershift-operator/controllers/nodepool/conditions.go:783 — NodePoolReconciler.setAllMachinesReadyCondition has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · vacuouspass.run (cognitive 45) · ×1
  • vacuouspass.run (cognitive 45) hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:29 — vacuouspass.run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 6 (30 pts), loops 4 (12 pts), match/switch 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DefragController.runDefrag (cognitive 44) · ×1
  • DefragController.runDefrag (cognitive 44) etcd-defrag/etcddefrag_controller.go:131 — DefragController.runDefrag has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 4, boolean chains 2 (nesting depth added 18). Of this number, 38 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.
D2 · Cognitive Complexity · Reconciler.reconcileDeletion (cognitive 44) · ×1
  • Reconciler.reconcileDeletion (cognitive 44) karpenter-operator/controllers/karpenter/karpenter_controller.go:440 — Reconciler.reconcileDeletion has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PRReportGenerator.generate_report (cognitive 44) · ×1
  • PRReportGenerator.generate_report (cognitive 44) contrib/repo_metrics/weekly_pr_report.py:1064 — PRReportGenerator.generate_report has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 11 (15 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.CreateCluster (cognitive 43) · ×1
  • core.CreateCluster (cognitive 43) cmd/cluster/core/create.go:1104 — core.CreateCluster has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 2 (5 pts) (nesting depth added 18). Of this number, 40 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyRouteTables (cognitive 43) · ×1
  • DestroyInfraOptions.DestroyRouteTables (cognitive 43) cmd/infra/aws/destroy.go:528 — DestroyInfraOptions.DestroyRouteTables has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 4 (9 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.InstallHyperShiftOperator (cognitive 43) · ×1
  • install.InstallHyperShiftOperator (cognitive 43) cmd/install/install.go:552 — install.InstallHyperShiftOperator has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (42 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.
D2 · Cognitive Complexity · network.ReconcileNetworkOperator (cognitive 43) · ×1
  • network.ReconcileNetworkOperator (cognitive 43) control-plane-operator/hostedclusterconfigoperator/controllers/resources/network/reconcile.go:39 — network.ReconcileNetworkOperator has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (39 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CertificateRevocationController.ensureNewSignerCertificatePropagated (cognitive 43) · ×1
  • CertificateRevocationController.ensureNewSignerCertificatePropagated (cognitive 43) REDACTED:705 — CertificateRevocationController.ensureNewSignerCertificatePropagated has cognitive complexity 43 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · proxyResolver.Resolve (cognitive 43) · ×1
  • proxyResolver.Resolve (cognitive 43) support/konnectivityproxy/resolver.go:110 — proxyResolver.Resolve has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (41 pts), boolean chains 2 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · update_trusted_task_bundles.print_summary (cognitive 43) · ×1
  • update_trusted_task_bundles.print_summary (cognitive 43) hack/tools/scripts/update_trusted_task_bundles.py:437 — update_trusted_task_bundles.print_summary has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 6 (15 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.ensureCloudResourcesDestroyed (cognitive 42) · ×1
  • reconciler.ensureCloudResourcesDestroyed (cognitive 42) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2529 — reconciler.ensureCloudResourcesDestroyed has cognitive complexity 42 (threshold 15). Drivers by points: if/else 29 (42 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.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings (cognitive 42) · ×1
  • HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings (cognitive 42) REDACTED:5761 — HostedClusterReconciler.reconcileKubevirtPlatformDefaultSettings has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 4 (nesting depth added 19). Of this number, 36 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.
D2 · Cognitive Complexity · generate_ownership.build_rules (cognitive 42) · ×1
  • generate_ownership.build_rules (cognitive 42) skills/restructure-commits/generate_ownership.py:225 — generate_ownership.build_rules has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 8 (11 pts), boolean chains 9, ternaries 2 (6 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.
D2 · Cognitive Complexity · main.setupNodePoolController (cognitive 41) · ×1
  • main.setupNodePoolController (cognitive 41) hypershift-operator/main.go:765 — main.setupNodePoolController has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · releaseinfo.readComponentVersions (cognitive 41) · ×1
  • releaseinfo.readComponentVersions (cognitive 41) support/releaseinfo/releaseinfo.go:149 — releaseinfo.readComponentVersions has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 5 (6 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · registryclient.ExtractImageFilesToDir (cognitive 41) · ×1
  • registryclient.ExtractImageFilesToDir (cognitive 41) REDACTED:180 — registryclient.ExtractImageFilesToDir has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 2 (3 pts) (nesting depth added 26). Most of this is not in the body itself: 5 of the 41 points are its own statements and the rest belongs to one function literal inside it that branches (line 195). 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.
D2 · Cognitive Complexity · ValidatedCreateOptions.Complete (cognitive 40) · ×1
  • ValidatedCreateOptions.Complete (cognitive 40) cmd/cluster/aws/create.go:113 — ValidatedCreateOptions.Complete has cognitive complexity 40 (threshold 15). Drivers by points: if/else 23 (38 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RBACManager.assignRole (cognitive 40) · ×1
  • RBACManager.assignRole (cognitive 40) cmd/infra/azure/rbac.go:247 — RBACManager.assignRole has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileCPOV2 (cognitive 40) · ×1
  • HostedControlPlaneReconciler.reconcileCPOV2 (cognitive 40) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1393 — HostedControlPlaneReconciler.reconcileCPOV2 has cognitive complexity 40 (threshold 15). Drivers by points: if/else 25 (36 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · placeholderUpdater.reconcile (cognitive 40) · ×1
  • placeholderUpdater.reconcile (cognitive 40) hypershift-operator/controllers/scheduler/aws/placeholders.go:287 — placeholderUpdater.reconcile has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 5 (12 pts), boolean chains 4 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalogs.computeCatalogImages (cognitive 40) · ×1
  • catalogs.computeCatalogImages (cognitive 40) support/catalogs/images.go:125 — catalogs.computeCatalogImages has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (12 pts), match/switch 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KonnectivityContainerOptions.buildContainer (cognitive 40) · ×1
  • KonnectivityContainerOptions.buildContainer (cognitive 40) support/controlplane-component/konnectivity-container.go:141 — KonnectivityContainerOptions.buildContainer has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · secretencryption.FindKeyRole (cognitive 40) · ×1
  • secretencryption.FindKeyRole (cognitive 40) support/secretencryption/encryptionconfig.go:135 — secretencryption.FindKeyRole has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateOptions.GenerateNodePools (cognitive 39) · ×1
  • CreateOptions.GenerateNodePools (cognitive 39) cmd/cluster/azure/create.go:555 — CreateOptions.GenerateNodePools has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · core.forceRemoveAllFinalizers (cognitive 39) · ×1
  • core.forceRemoveAllFinalizers (cognitive 39) cmd/cluster/core/destroy.go:339 — core.forceRemoveAllFinalizers has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyInfra (cognitive 39) · ×1
  • DestroyInfraOptions.DestroyInfra (cognitive 39) cmd/infra/powervs/destroy.go:155 — DestroyInfraOptions.DestroyInfra has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27 (36 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kas.NewConfigParams (cognitive 39) · ×1
  • kas.NewConfigParams (cognitive 39) control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go:68 — kas.NewConfigParams has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CertificateRevocationController.ensureOldSignerCertificateRevoked (cognitive 39) · ×1
  • CertificateRevocationController.ensureOldSignerCertificateRevoked (cognitive 39) REDACTED:998 — CertificateRevocationController.ensureOldSignerCertificateRevoked has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · placeholderCreator.reconcile (cognitive 39) · ×1
  • placeholderCreator.reconcile (cognitive 39) hypershift-operator/controllers/scheduler/aws/placeholders.go:179 — placeholderCreator.reconcile has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · registryclient.ExtractImageFiles (cognitive 39) · ×1
  • registryclient.ExtractImageFiles (cognitive 39) REDACTED:50 — registryclient.ExtractImageFiles has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 3 (4 pts) (nesting depth added 23). Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 67). 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.
D2 · Cognitive Complexity · core.parseEtcdShard (cognitive 38) · ×1
  • core.parseEtcdShard (cognitive 38) cmd/cluster/core/etcd_shards.go:85 — core.parseEtcdShard has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 2 (5 pts), boolean chains 1, 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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceReconciler.Reconcile (cognitive 38) · ×1
  • AzurePrivateLinkServiceReconciler.Reconcile (cognitive 38) control-plane-operator/controllers/azureprivatelinkservice/controller.go:247 — AzurePrivateLinkServiceReconciler.Reconcile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.processFile (cognitive 38) · ×1
  • main.processFile (cognitive 38) REDACTED:200 — main.processFile has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 9 (14 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · main.stripDecls (cognitive 38) · ×1
  • main.stripDecls (cognitive 38) REDACTED:658 — main.stripDecls has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 7 (9 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · validations.ValidateOCPAPIServerSANs (cognitive 38) · ×1
  • validations.ValidateOCPAPIServerSANs (cognitive 38) hypershift-operator/controllers/hostedcluster/validations/ocpapiserver.go:28 — validations.ValidateOCPAPIServerSANs has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.checkCRDsInDir (cognitive 38) · ×1
  • main.checkCRDsInDir (cognitive 38) hack/tools/crd-schema-check/main.go:131 — main.checkCRDsInDir has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 6 (13 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.
D2 · Cognitive Complexity · configrefs.oauthSecretRefs (cognitive 37) · ×1
  • configrefs.oauthSecretRefs (cognitive 37) api/util/configrefs/refs.go:124 — configrefs.oauthSecretRefs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateInfraOptions.handleIdentitiesAndRBAC (cognitive 37) · ×1
  • CreateInfraOptions.handleIdentitiesAndRBAC (cognitive 37) cmd/infra/azure/create.go:239 — CreateInfraOptions.handleIdentitiesAndRBAC has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kas.adaptDeployment (cognitive 37) · ×1
  • kas.adaptDeployment (cognitive 37) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:69 — kas.adaptDeployment has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). Of this number, 36 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.
D2 · Cognitive Complexity · Reconciler.reconcileInPlaceUpgrade (cognitive 37) · ×1
  • Reconciler.reconcileInPlaceUpgrade (cognitive 37) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:179 — Reconciler.reconcileInPlaceUpgrade has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 1 (nesting depth added 15). Of this number, 33 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.
D2 · Cognitive Complexity · main.loadCAPIPackage (cognitive 37) · ×1
  • main.loadCAPIPackage (cognitive 37) REDACTED:1105 — main.loadCAPIPackage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (15 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileSecretEncryptionSync (cognitive 37) · ×1
  • HostedClusterReconciler.reconcileSecretEncryptionSync (cognitive 37) REDACTED:2121 — HostedClusterReconciler.reconcileSecretEncryptionSync has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 2, match/switch 1 (nesting depth added 19). Of this number, 32 points are the body's own statements and 5 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.
D2 · Cognitive Complexity · nodepool.usesRuncRuntime (cognitive 37) · ×1
  • nodepool.usesRuncRuntime (cognitive 37) hypershift-operator/controllers/nodepool/osstream.go:34 — nodepool.usesRuncRuntime has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CreateOptions.ApplyPlatformSpecifics (cognitive 36) · ×1
  • CreateOptions.ApplyPlatformSpecifics (cognitive 36) cmd/cluster/aws/create.go:231 — CreateOptions.ApplyPlatformSpecifics has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (27 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.crdIncludeFilter (cognitive 36) · ×1
  • install.crdIncludeFilter (cognitive 36) cmd/install/install.go:993 — install.crdIncludeFilter has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 16). None of this is in the body itself: all 36 points belong to one function literal inside it that branches (line 994). 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileDefaultSecurityGroup (cognitive 36) · ×1
  • HostedControlPlaneReconciler.reconcileDefaultSecurityGroup (cognitive 36) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3088 — HostedControlPlaneReconciler.reconcileDefaultSecurityGroup has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 2 (nesting depth added 14). Of this number, 26 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · Reconciler.reconcileUpgradePods (cognitive 36) · ×1
  • Reconciler.reconcileUpgradePods (cognitive 36) control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go:317 — Reconciler.reconcileUpgradePods has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · reconciler.reconcileKubevirtPassthroughService (cognitive 36) · ×1
  • reconciler.reconcileKubevirtPassthroughService (cognitive 36) control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:97 — reconciler.reconcileKubevirtPassthroughService has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CertificateRevocationController.prunePreviousSignerCertificates (cognitive 36) · ×1
  • CertificateRevocationController.prunePreviousSignerCertificates (cognitive 36) REDACTED:870 — CertificateRevocationController.prunePreviousSignerCertificates has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hostedcluster.reconcileHostedControlPlane (cognitive 36) · ×1
  • hostedcluster.reconcileHostedControlPlane (cognitive 36) REDACTED:3021 — hostedcluster.reconcileHostedControlPlane has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 3, loops 2, match/switch 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · globalconfig.ReconcileInfrastructure (cognitive 36) · ×1
  • globalconfig.ReconcileInfrastructure (cognitive 36) support/globalconfig/infrastructure.go:31 — globalconfig.ReconcileInfrastructure has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 3 (6 pts), match/switch 2, boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tokenminter.mintToken (cognitive 36) · ×1
  • tokenminter.mintToken (cognitive 36) token-minter/tokenminter.go:119 — tokenminter.mintToken has cognitive complexity 36 (threshold 15). Drivers by points: if/else 24 (35 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.
D2 · Cognitive Complexity · commit_layout.cmd_verify (cognitive 36) · ×1
  • commit_layout.cmd_verify (cognitive 36) skills/restructure-commits/commit_layout.py:210 — commit_layout.cmd_verify has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 3 (7 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dump.DumpCluster (cognitive 35) · ×1
  • dump.DumpCluster (cognitive 35) REDACTED:444 — dump.DumpCluster has cognitive complexity 35 (threshold 15). Drivers by points: if/else 23 (30 pts), loops 4, boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · kas.generateConfig (cognitive 35) · ×1
  • kas.generateConfig (cognitive 35) control-plane-operator/controllers/hostedcontrolplane/v2/kas/config.go:98 — kas.generateConfig has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 4, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HCPEtcdBackupReconciler.handleJobStatus (cognitive 35) · ×1
  • HCPEtcdBackupReconciler.handleJobStatus (cognitive 35) hypershift-operator/controllers/etcdbackup/reconciler.go:532 — HCPEtcdBackupReconciler.handleJobStatus has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HAProxy.reconcileHAProxyIgnitionConfig (cognitive 35) · ×1
  • HAProxy.reconcileHAProxyIgnitionConfig (cognitive 35) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:103 — HAProxy.reconcileHAProxyIgnitionConfig has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.Reconcile (cognitive 35) · ×1
  • AWSEndpointServiceReconciler.Reconcile (cognitive 35) REDACTED:269 — AWSEndpointServiceReconciler.Reconcile has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (35 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.Reconcile (cognitive 34) · ×1
  • HostedControlPlaneReconciler.Reconcile (cognitive 34) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:741 — HostedControlPlaneReconciler.Reconcile has cognitive complexity 34 (threshold 15). Drivers by points: if/else 26 (31 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcilePKI (cognitive 34) · ×1
  • HostedControlPlaneReconciler.reconcilePKI (cognitive 34) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2213 — HostedControlPlaneReconciler.reconcilePKI has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24 (33 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.removeCloudResources (cognitive 34) · ×1
  • HostedControlPlaneReconciler.removeCloudResources (cognitive 34) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2943 — HostedControlPlaneReconciler.removeCloudResources has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 9 (nesting depth added 10). Of this number, 26 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.
D2 · Cognitive Complexity · recovery.RecoverMonitoringStack (cognitive 34) · ×1
  • recovery.RecoverMonitoringStack (cognitive 34) control-plane-operator/hostedclusterconfigoperator/controllers/resources/recovery/recovery.go:24 — recovery.RecoverMonitoringStack has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 2 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · conditions.ExpectedHCConditions (cognitive 34) · ×1
  • conditions.ExpectedHCConditions (cognitive 34) support/conditions/conditions.go:12 — conditions.ExpectedHCConditions has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 6, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyInfraOptions.Run (cognitive 33) · ×1
  • DestroyInfraOptions.Run (cognitive 33) cmd/infra/azure/destroy.go:111 — DestroyInfraOptions.Run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (32 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kas.ReconcilePrivateService (cognitive 33) · ×1
  • kas.ReconcilePrivateService (cognitive 33) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:228 — kas.ReconcilePrivateService has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kas.deriveKMSKeys (cognitive 33) · ×1
  • kas.deriveKMSKeys (cognitive 33) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms.go:86 — kas.deriveKMSKeys has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 4, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · main.main (cognitive 33) · ×1
  • main.main (cognitive 33) REDACTED:74 — main.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 5 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hostedcluster.validateSliceNetworkCIDRs (cognitive 33) · ×1
  • hostedcluster.validateSliceNetworkCIDRs (cognitive 33) REDACTED:5203 — hostedcluster.validateSliceNetworkCIDRs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5, loops 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.
D2 · Cognitive Complexity · SharedIngressReconciler.reconcileRouter (cognitive 33) · ×1
  • SharedIngressReconciler.reconcileRouter (cognitive 33) hypershift-operator/controllers/sharedingress/sharedingress_controller.go:187 — SharedIngressReconciler.reconcileRouter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (32 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.
D2 · Cognitive Complexity · Handler.resolveTopOwner (cognitive 32) · ×1
  • Handler.resolveTopOwner (cognitive 32) contrib/gomaxprocs-webhook/internal/webhook/pod/handler.go:147 — Handler.resolveTopOwner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), jumps 5, boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileDeletion (cognitive 32) · ×1
  • HostedControlPlaneReconciler.reconcileDeletion (cognitive 32) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:436 — HostedControlPlaneReconciler.reconcileDeletion has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reconciler.reconcileOAuthServiceStatus (cognitive 32) · ×1
  • Reconciler.reconcileOAuthServiceStatus (cognitive 32) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:601 — Reconciler.reconcileOAuthServiceStatus has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · reconciler.Reconcile (cognitive 32) · ×1
  • reconciler.Reconcile (cognitive 32) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:361 — reconciler.Reconcile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 25 (28 pts), boolean chains 4 (nesting depth added 3). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.computeClosure (cognitive 32) · ×1
  • main.computeClosure (cognitive 32) REDACTED:957 — main.computeClosure has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 18). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to one function literal inside it that branches (line 1001). 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.
D2 · Cognitive Complexity · NodePoolReconciler.ntoReconcile (cognitive 32) · ×1
  • NodePoolReconciler.ntoReconcile (cognitive 32) hypershift-operator/controllers/nodepool/nto.go:494 — NodePoolReconciler.ntoReconcile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.run (cognitive 32) · ×1
  • main.run (cognitive 32) hypershift-operator/main.go:270 — main.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 29 (32 pts) (nesting depth added 3). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · EC2NodeClassReconciler.Reconcile (cognitive 32) · ×1
  • EC2NodeClassReconciler.Reconcile (cognitive 32) karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:118 — EC2NodeClassReconciler.Reconcile has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (31 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.
D2 · Cognitive Complexity · kubevirtexternalinfra.ValidateKubeConfig (cognitive 32) · ×1
  • kubevirtexternalinfra.ValidateKubeConfig (cognitive 32) kubevirtexternalinfra/externalinfra.go:318 — kubevirtexternalinfra.ValidateKubeConfig has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 3 (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.
D2 · Cognitive Complexity · PRReportGenerator.fetch_all_prs (cognitive 32) · ×1
  • PRReportGenerator.fetch_all_prs (cognitive 32) contrib/repo_metrics/weekly_pr_report.py:908 — PRReportGenerator.fetch_all_prs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (21 pts), error handling 2 (5 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · verify-docs-nav-order.check_section_order (cognitive 32) · ×1
  • verify-docs-nav-order.check_section_order (cognitive 32) hack/verify-docs-nav-order.py:87 — verify-docs-nav-order.check_section_order has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (11 pts), loops 4 (7 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · azure.newAPIJournalCollector (cognitive 31) · ×1
  • azure.newAPIJournalCollector (cognitive 31) cmd/consolelogs/azure/api_journals.go:60 — azure.newAPIJournalCollector has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). Of this number, 30 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroySecurityGroups (cognitive 31) · ×1
  • DestroyInfraOptions.DestroySecurityGroups (cognitive 31) cmd/infra/aws/destroy.go:594 — DestroyInfraOptions.DestroySecurityGroups has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyIAMOptions.DestroyWorkerInstanceProfile (cognitive 31) · ×1
  • DestroyIAMOptions.DestroyWorkerInstanceProfile (cognitive 31) cmd/infra/aws/destroy_iam.go:284 — DestroyIAMOptions.DestroyWorkerInstanceProfile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.etcdRestoredCondition (cognitive 31) · ×1
  • HostedControlPlaneReconciler.etcdRestoredCondition (cognitive 31) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2851 — HostedControlPlaneReconciler.etcdRestoredCondition has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (7 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · main.localizeFile (cognitive 31) · ×1
  • main.localizeFile (cognitive 31) REDACTED:1316 — main.localizeFile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 4 (6 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocalIgnitionProvider.GetPayload (cognitive 31) · ×1
  • LocalIgnitionProvider.GetPayload (cognitive 31) REDACTED:687 — LocalIgnitionProvider.GetPayload has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 2 (nesting depth added 2). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · controlPlaneWorkload.update (cognitive 31) · ×1
  • controlPlaneWorkload.update (cognitive 31) support/controlplane-component/controlplane-component.go:305 — controlPlaneWorkload.update has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 16). Of this number, 21 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · main.main (cognitive 31) · ×1
  • main.main (cognitive 31) hack/tools/check-konflux-triggers/main.go:75 — main.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 3, 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.
D2 · Cognitive Complexity · ho_release_gate.poll_until_complete (cognitive 31) · ×1
  • ho_release_gate.poll_until_complete (cognitive 31) .tekton/lib/ho_release_gate.py:194 — ho_release_gate.poll_until_complete has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.healthCheckKASLoadBalancers (cognitive 30) · ×1
  • HostedControlPlaneReconciler.healthCheckKASLoadBalancers (cognitive 30) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1121 — HostedControlPlaneReconciler.healthCheckKASLoadBalancers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileNetworkServingCerts (cognitive 30) · ×1
  • HostedControlPlaneReconciler.reconcileNetworkServingCerts (cognitive 30) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1973 — HostedControlPlaneReconciler.reconcileNetworkServingCerts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (30 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.run (cognitive 30) · ×1
  • main.run (cognitive 30) karpenter-operator/main.go:86 — main.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (29 pts), loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · registryclient.ExtractImageFile (cognitive 30) · ×1
  • registryclient.ExtractImageFile (cognitive 30) REDACTED:127 — registryclient.ExtractImageFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (3 pts) (nesting depth added 18). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 137). 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.
D2 · Cognitive Complexity · applyProvider.update (cognitive 30) · ×1
  • applyProvider.update (cognitive 30) support/upsert/apply.go:116 — applyProvider.update has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 2, match/switch 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.main (cognitive 30) · ×1
  • main.main (cognitive 30) hack/tools/release/notes.go:32 — main.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (8 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.
D2 · Cognitive Complexity · PRReportGenerator._github_graphql_request (cognitive 30) · ×1
  • PRReportGenerator._github_graphql_request (cognitive 30) contrib/repo_metrics/weekly_pr_report.py:410 — PRReportGenerator._github_graphql_request has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (26 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PRReportGenerator.fetch_repository_contributors (cognitive 30) · ×1
  • PRReportGenerator.fetch_repository_contributors (cognitive 30) contrib/repo_metrics/weekly_pr_report.py:478 — PRReportGenerator.fetch_repository_contributors has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 4 (10 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateIAMOptions.CreateOIDCResources (cognitive 29) · ×1
  • CreateIAMOptions.CreateOIDCResources (cognitive 29) cmd/infra/aws/iam.go:859 — CreateIAMOptions.CreateOIDCResources has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.setupAuth (cognitive 29) · ×1
  • install.setupAuth (cognitive 29) cmd/install/install.go:1713 — install.setupAuth has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KarpenterIgnitionReconciler.Reconcile (cognitive 29) · ×1
  • KarpenterIgnitionReconciler.Reconcile (cognitive 29) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:96 — KarpenterIgnitionReconciler.Reconcile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (28 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.
D2 · Cognitive Complexity · CRDMigrator.Reconcile (cognitive 29) · ×1
  • CRDMigrator.Reconcile (cognitive 29) support/capi-crdmigrator/crd_migrator.go:163 — CRDMigrator.Reconcile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 4 (nesting depth added 7). Of this number, 22 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RegistryClientImageMetadataProvider.seekOverride (cognitive 29) · ×1
  • RegistryClientImageMetadataProvider.seekOverride (cognitive 29) support/imageregistry/imagemetadata.go:540 — RegistryClientImageMetadataProvider.seekOverride has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · upsert.defaultMutatingWebhookConfiguration (cognitive 29) · ×1
  • upsert.defaultMutatingWebhookConfiguration (cognitive 29) support/upsert/upsert.go:467 — upsert.defaultMutatingWebhookConfiguration has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (4 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.
D2 · Cognitive Complexity · main.run (cognitive 29) · ×1
  • main.run (cognitive 29) hack/tools/deadcode-report/main.go:47 — main.run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (27 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.readFindings (cognitive 29) · ×1
  • main.readFindings (cognitive 29) hack/tools/deadcode-report/report.go:46 — main.readFindings has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 11). Of this number, 25 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.
D2 · Cognitive Complexity · testfuncstructure.collectProductionSymbols (cognitive 29) · ×1
  • testfuncstructure.collectProductionSymbols (cognitive 29) hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go:125 — testfuncstructure.collectProductionSymbols has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · vacuouspass.extractNonEmptyGuardTarget (cognitive 29) · ×1
  • vacuouspass.extractNonEmptyGuardTarget (cognitive 29) hack/tools/hypershiftlinter/analyzers/vacuouspass/vacuouspass.go:255 — vacuouspass.extractNonEmptyGuardTarget has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 10). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 265). 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.
D2 · Cognitive Complexity · azure.azureConfig (cognitive 28) · ×1
  • azure.azureConfig (cognitive 28) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/config.go:71 — azure.azureConfig has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kas.generateIssuer (cognitive 28) · ×1
  • kas.generateIssuer (cognitive 28) control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:116 — kas.generateIssuer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.reconcileNetworkingAndSecrets (cognitive 28) · ×1
  • reconciler.reconcileNetworkingAndSecrets (cognitive 28) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:905 — reconciler.reconcileNetworkingAndSecrets has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 2, loops 1 (nesting depth added 8). Of this number, 24 points are the body's own statements and 4 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.
D2 · Cognitive Complexity · NodePoolReconciler.reconcileScaleFromZeroAnnotations (cognitive 28) · ×1
  • NodePoolReconciler.reconcileScaleFromZeroAnnotations (cognitive 28) hypershift-operator/controllers/nodepool/nodepool_controller.go:1550 — NodePoolReconciler.reconcileScaleFromZeroAnnotations has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (27 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.
D2 · Cognitive Complexity · openstack.MachineTemplateSpec (cognitive 28) · ×1
  • openstack.MachineTemplateSpec (cognitive 28) hypershift-operator/controllers/nodepool/openstack/openstack.go:20 — openstack.MachineTemplateSpec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (5 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · secretJanitor.Reconcile (cognitive 28) · ×1
  • secretJanitor.Reconcile (cognitive 28) hypershift-operator/controllers/nodepool/secret_janitor.go:35 — secretJanitor.Reconcile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WebhookCertReconciler.patchWebhookConfigsCABundle (cognitive 28) · ×1
  • WebhookCertReconciler.patchWebhookConfigsCABundle (cognitive 28) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:192 — WebhookCertReconciler.patchWebhookConfigsCABundle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · capabilities.DetectManagementClusterCapabilities (cognitive 28) · ×1
  • capabilities.DetectManagementClusterCapabilities (cognitive 28) support/capabilities/management_cluster_capabilities.go:136 — capabilities.DetectManagementClusterCapabilities has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28. 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.
D2 · Cognitive Complexity · CRDMigrator.reconcileCleanupManagedFields (cognitive 28) · ×1
  • CRDMigrator.reconcileCleanupManagedFields (cognitive 28) support/capi-crdmigrator/crd_migrator.go:397 — CRDMigrator.reconcileCleanupManagedFields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2, boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 419). 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.
D2 · Cognitive Complexity · verify-tekton-pipeline-pairs._strip_and_paren_blocks (cognitive 28) · ×1
  • verify-tekton-pipeline-pairs._strip_and_paren_blocks (cognitive 28) hack/verify-tekton-pipeline-pairs.py:161 — verify-tekton-pipeline-pairs._strip_and_paren_blocks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (10 pts), boolean chains 4 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CreateBastionOpts.Run (cognitive 27) · ×1
  • CreateBastionOpts.Run (cognitive 27) cmd/bastion/aws/create.go:119 — CreateBastionOpts.Run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (26 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.
D2 · Cognitive Complexity · powervs.getCISDomainDetails (cognitive 27) · ×1
  • powervs.getCISDomainDetails (cognitive 27) cmd/infra/powervs/create.go:479 — powervs.getCISDomainDetails has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 500). 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.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.reconcileExternalServices (cognitive 27) · ×1
  • GCPPrivateServiceConnectReconciler.reconcileExternalServices (cognitive 27) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:532 — GCPPrivateServiceConnectReconciler.reconcileExternalServices has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (5 pts), match/switch 1 (3 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.
D2 · Cognitive Complexity · FirewallManager.Delete (cognitive 27) · ×1
  • FirewallManager.Delete (cognitive 27) control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:373 — FirewallManager.Delete has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (26 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.
D2 · Cognitive Complexity · ingress.ReconcileRouterService (cognitive 27) · ×1
  • ingress.ReconcileRouterService (cognitive 27) control-plane-operator/controllers/hostedcontrolplane/ingress/router.go:24 — ingress.ReconcileRouterService has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · pki.previousDirectCertificates (cognitive 27) · ×1
  • pki.previousDirectCertificates (cognitive 27) control-plane-operator/controllers/hostedcontrolplane/pki/ca.go:265 — pki.previousDirectCertificates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (9 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.
D2 · Cognitive Complexity · etcd.adaptStatefulSet (cognitive 27) · ×1
  • etcd.adaptStatefulSet (cognitive 27) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/statefulset.go:42 — etcd.adaptStatefulSet has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (22 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). Of this number, 20 points are the body's own statements and 7 belong to 3 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.
D2 · Cognitive Complexity · kas.updateMainContainer (cognitive 27) · ×1
  • kas.updateMainContainer (cognitive 27) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:270 — kas.updateMainContainer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). None of this is in the body itself: all 27 points belong to one function literal inside it that branches (line 271). 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.
D2 · Cognitive Complexity · main.newOperatorImageLookup (cognitive 27) · ×1
  • main.newOperatorImageLookup (cognitive 27) control-plane-operator/main.go:198 — main.newOperatorImageLookup has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 14). None of this is in the body itself: all 27 points belong to one function literal inside it that branches (line 199). 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.
D2 · Cognitive Complexity · nodepool.setScaleFromZeroAnnotationsOnObject (cognitive 27) · ×1
  • nodepool.setScaleFromZeroAnnotationsOnObject (cognitive 27) hypershift-operator/controllers/nodepool/scale_from_zero.go:74 — nodepool.setScaleFromZeroAnnotationsOnObject has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kubevirt.MachineTemplateSpec (cognitive 27) · ×1
  • kubevirt.MachineTemplateSpec (cognitive 27) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:434 — kubevirt.MachineTemplateSpec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (23 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.
D2 · Cognitive Complexity · NodePoolReconciler.updatingVersionCondition (cognitive 27) · ×1
  • NodePoolReconciler.updatingVersionCondition (cognitive 27) hypershift-operator/controllers/nodepool/conditions.go:550 — NodePoolReconciler.updatingVersionCondition has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (27 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.
D2 · Cognitive Complexity · NodePoolReconciler.enqueueNodePoolsForConfig (cognitive 27) · ×1
  • NodePoolReconciler.enqueueNodePoolsForConfig (cognitive 27) hypershift-operator/controllers/nodepool/nodepool_controller.go:1124 — NodePoolReconciler.enqueueNodePoolsForConfig has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (8 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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceController.lookupILBByFrontendIP (cognitive 27) · ×1
  • AzurePrivateLinkServiceController.lookupILBByFrontendIP (cognitive 27) hypershift-operator/controllers/platform/azure/controller.go:382 — AzurePrivateLinkServiceController.lookupILBByFrontendIP has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (6 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · util.setHostedClusterSchedulingAnnotations (cognitive 27) · ×1
  • util.setHostedClusterSchedulingAnnotations (cognitive 27) hypershift-operator/controllers/scheduler/util/scheduler.go:21 — util.setHostedClusterSchedulingAnnotations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7, 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.
D2 · Cognitive Complexity · controlPlaneWorkload.setDefaultOptions (cognitive 27) · ×1
  • controlPlaneWorkload.setDefaultOptions (cognitive 27) support/controlplane-component/defaults.go:115 — controlPlaneWorkload.setDefaultOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RawCreateOptions.Validate (cognitive 26) · ×1
  • RawCreateOptions.Validate (cognitive 26) cmd/cluster/azure/create.go:169 — RawCreateOptions.Validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateInfraOptions.createPerZoneResources (cognitive 26) · ×1
  • CreateInfraOptions.createPerZoneResources (cognitive 26) cmd/infra/aws/create.go:322 — CreateInfraOptions.createPerZoneResources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reconciler.reconcileOAuthServerService (cognitive 26) · ×1
  • Reconciler.reconcileOAuthServerService (cognitive 26) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:338 — Reconciler.reconcileOAuthServerService has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 1 (nesting depth added 10). Of this number, 24 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.
D2 · Cognitive Complexity · reconciler.ensureIngressControllersRemoved (cognitive 26) · ×1
  • reconciler.ensureIngressControllersRemoved (cognitive 26) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2877 — reconciler.ensureIngressControllersRemoved has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcilePublicEndpointExposedCondition (cognitive 26) · ×1
  • HostedClusterReconciler.reconcilePublicEndpointExposedCondition (cognitive 26) REDACTED:6340 — HostedClusterReconciler.reconcilePublicEndpointExposedCondition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileAutoNodeEnabledCondition (cognitive 26) · ×1
  • HostedClusterReconciler.reconcileAutoNodeEnabledCondition (cognitive 26) hypershift-operator/controllers/hostedcluster/karpenter.go:180 — HostedClusterReconciler.reconcileAutoNodeEnabledCondition has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcilePlatformNetworkPolicies (cognitive 26) · ×1
  • HostedClusterReconciler.reconcilePlatformNetworkPolicies (cognitive 26) hypershift-operator/controllers/hostedcluster/network_policies.go:162 — HostedClusterReconciler.reconcilePlatformNetworkPolicies has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Reconciler.Reconcile (cognitive 26) · ×1
  • Reconciler.Reconcile (cognitive 26) hypershift-operator/controllers/ignitionpayload/controller.go:105 — Reconciler.Reconcile has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · releaseinfo.parseComponentVersionsLabel (cognitive 26) · ×1
  • releaseinfo.parseComponentVersionsLabel (cognitive 26) support/releaseinfo/releaseinfo.go:235 — releaseinfo.parseComponentVersionsLabel has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JiraClient._fetch_json (cognitive 26) · ×1
  • JiraClient._fetch_json (cognitive 26) contrib/repo_metrics/weekly_pr_report.py:87 — JiraClient._fetch_json has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configrefs.oauthConfigMapRefs (cognitive 25) · ×1
  • configrefs.oauthConfigMapRefs (cognitive 25) api/util/configrefs/refs.go:183 — configrefs.oauthConfigMapRefs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateInfraOptions.CreatePublicRouteTable (cognitive 25) · ×1
  • CreateInfraOptions.CreatePublicRouteTable (cognitive 25) cmd/infra/aws/ec2.go:480 — CreateInfraOptions.CreatePublicRouteTable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyInfraOptions.deleteClusterResourcesInGroup (cognitive 25) · ×1
  • DestroyInfraOptions.deleteClusterResourcesInGroup (cognitive 25) cmd/infra/azure/destroy.go:207 — DestroyInfraOptions.deleteClusterResourcesInGroup has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.reconcileDelete (cognitive 25) · ×1
  • GCPPrivateServiceConnectReconciler.reconcileDelete (cognitive 25) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:867 — GCPPrivateServiceConnectReconciler.reconcileDelete has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (25 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.
D2 · Cognitive Complexity · reconciler.reconcileIngressController (cognitive 25) · ×1
  • reconciler.reconcileIngressController (cognitive 25) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1148 — reconciler.reconcileIngressController has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.NewStartCommand (cognitive 25) · ×1
  • main.NewStartCommand (cognitive 25) control-plane-operator/main.go:323 — main.NewStartCommand has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22 (23 pts), boolean chains 1, loops 1 (nesting depth added 1). None of this is in the body itself: all 25 points belong to one function literal inside it that branches (line 367). 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.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcilePlatformSpecific (cognitive 25) · ×1
  • HostedClusterReconciler.reconcilePlatformSpecific (cognitive 25) REDACTED:2646 — HostedClusterReconciler.reconcilePlatformSpecific has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NodePoolReconciler.Reconcile (cognitive 25) · ×1
  • NodePoolReconciler.Reconcile (cognitive 25) hypershift-operator/controllers/nodepool/nodepool_controller.go:208 — NodePoolReconciler.Reconcile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (25 pts) (nesting depth added 7). Of this number, 24 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.
D2 · Cognitive Complexity · genericAdapter.reconcile (cognitive 25) · ×1
  • genericAdapter.reconcile (cognitive 25) support/controlplane-component/generic-adapter.go:62 — genericAdapter.reconcile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateIAMOptions.CreateSharedOIDCRole (cognitive 24) · ×1
  • CreateIAMOptions.CreateSharedOIDCRole (cognitive 24) cmd/infra/aws/iam.go:1042 — CreateIAMOptions.CreateSharedOIDCRole has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateIAMOptions.CreateWorkerInstanceProfile (cognitive 24) · ×1
  • CreateIAMOptions.CreateWorkerInstanceProfile (cognitive 24) cmd/infra/aws/iam.go:1125 — CreateIAMOptions.CreateWorkerInstanceProfile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyV2ELBs (cognitive 24) · ×1
  • DestroyInfraOptions.DestroyV2ELBs (cognitive 24) cmd/infra/aws/destroy.go:403 — DestroyInfraOptions.DestroyV2ELBs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azure.cappedExponentialBackoffWithContext (cognitive 24) · ×1
  • azure.cappedExponentialBackoffWithContext (cognitive 24) cmd/infra/azure/networking.go:492 — azure.cappedExponentialBackoffWithContext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.destroyVpcLB (cognitive 24) · ×1
  • powervs.destroyVpcLB (cognitive 24) cmd/infra/powervs/destroy.go:609 — powervs.destroyVpcLB has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). None of this is in the body itself: all 24 points belong to 2 function literals inside it that branch (lines 626, 611). 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.
D2 · Cognitive Complexity · main.resolveExistingPrincipals (cognitive 24) · ×1
  • main.resolveExistingPrincipals (cognitive 24) contrib/azure-orphaned-role-assignments/main.go:333 — main.resolveExistingPrincipals has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AzurePrivateLinkServiceReconciler.reconcileDNSZone (cognitive 24) · ×1
  • AzurePrivateLinkServiceReconciler.reconcileDNSZone (cognitive 24) control-plane-operator/controllers/azureprivatelinkservice/controller.go:693 — AzurePrivateLinkServiceReconciler.reconcileDNSZone has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
D2 · Cognitive Complexity · Reconciler.reconcileHCPRouterServices (cognitive 24) · ×1
  • Reconciler.reconcileHCPRouterServices (cognitive 24) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:439 — Reconciler.reconcileHCPRouterServices has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kubevirt.adaptConfigMap (cognitive 24) · ×1
  • kubevirt.adaptConfigMap (cognitive 24) control-plane-operator/controllers/hostedcontrolplane/v2/csi/kubevirt/config.go:22 — kubevirt.adaptConfigMap has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 5 (9 pts), match/switch 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · metricsproxy.certVolumesFromMonitors (cognitive 24) · ×1
  • metricsproxy.certVolumesFromMonitors (cognitive 24) control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:60 — metricsproxy.certVolumesFromMonitors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (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.
D2 · Cognitive Complexity · oauth.adaptDeployment (cognitive 24) · ×1
  • oauth.adaptDeployment (cognitive 24) control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:36 — oauth.adaptDeployment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2 (nesting depth added 8). Of this number, 21 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.
D2 · Cognitive Complexity · Reconciler.reconcileGlobalPullSecret (cognitive 24) · ×1
  • Reconciler.reconcileGlobalPullSecret (cognitive 24) control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go:71 — Reconciler.reconcileGlobalPullSecret has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (22 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.
D2 · Cognitive Complexity · PodWebhookHandler.mutatePod (cognitive 24) · ×1
  • PodWebhookHandler.mutatePod (cognitive 24) hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:134 — PodWebhookHandler.mutatePod has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SnapshotReconciler.Reconcile (cognitive 24) · ×1
  • SnapshotReconciler.Reconcile (cognitive 24) hypershift-operator/controllers/auditlogpersistence/snapshot_controller.go:141 — SnapshotReconciler.Reconcile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hostedcluster.reconcileHostedControlPlaneAnnotations (cognitive 24) · ×1
  • hostedcluster.reconcileHostedControlPlaneAnnotations (cognitive 24) REDACTED:2892 — hostedcluster.reconcileHostedControlPlaneAnnotations has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 5 (7 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.
D2 · Cognitive Complexity · openstack.reconcileOpenStackClusterSpec (cognitive 24) · ×1
  • openstack.reconcileOpenStackClusterSpec (cognitive 24) hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:84 — openstack.reconcileOpenStackClusterSpec has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PowerVS.ReconcileCredentials (cognitive 24) · ×1
  • PowerVS.ReconcileCredentials (cognitive 24) hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:204 — PowerVS.ReconcileCredentials has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24. Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 226, 291, 327, …). 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.
D2 · Cognitive Complexity · CAPI.reconcileMachineDeploymentStatus (cognitive 24) · ×1
  • CAPI.reconcileMachineDeploymentStatus (cognitive 24) hypershift-operator/controllers/nodepool/capi.go:760 — CAPI.reconcileMachineDeploymentStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodePoolReconciler.updatingConfigCondition (cognitive 24) · ×1
  • NodePoolReconciler.updatingConfigCondition (cognitive 24) hypershift-operator/controllers/nodepool/conditions.go:451 — NodePoolReconciler.updatingConfigCondition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (24 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AzurePrivateLinkServiceController.reconcilePrivateLinkService (cognitive 24) · ×1
  • AzurePrivateLinkServiceController.reconcilePrivateLinkService (cognitive 24) hypershift-operator/controllers/platform/azure/controller.go:214 — AzurePrivateLinkServiceController.reconcilePrivateLinkService has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DedicatedServingComponentSchedulerAndSizer.Reconcile (cognitive 24) · ×1
  • DedicatedServingComponentSchedulerAndSizer.Reconcile (cognitive 24) REDACTED:431 — DedicatedServingComponentSchedulerAndSizer.Reconcile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · uwmtelemetry.reconcileUWMConfigContent (cognitive 24) · ×1
  • uwmtelemetry.reconcileUWMConfigContent (cognitive 24) hypershift-operator/controllers/uwmtelemetry/uwm_telemetry.go:206 — uwmtelemetry.reconcileUWMConfigContent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
D2 · Cognitive Complexity · LocalIgnitionProvider.extractMCOBinaries (cognitive 24) · ×1
  • LocalIgnitionProvider.extractMCOBinaries (cognitive 24) REDACTED:1009 — LocalIgnitionProvider.extractMCOBinaries has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2, boolean chains 1 (nesting depth added 9). Of this number, 21 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.
D2 · Cognitive Complexity · hcpstatuspatch.rhsAssignedToObject (cognitive 24) · ×1
  • hcpstatuspatch.rhsAssignedToObject (cognitive 24) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:242 — hcpstatuspatch.rhsAssignedToObject has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ipv6url.run (cognitive 24) · ×1
  • ipv6url.run (cognitive 24) hack/tools/hypershiftlinter/analyzers/ipv6url/ipv6url.go:28 — ipv6url.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, loops 1 (nesting depth added 11). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 35). 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.
D2 · Cognitive Complexity · PRReportGenerator._generate_impact_statement (cognitive 24) · ×1
  • PRReportGenerator._generate_impact_statement (cognitive 24) contrib/repo_metrics/weekly_pr_report.py:1319 — PRReportGenerator._generate_impact_statement has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · update_trusted_task_bundles.main (cognitive 24) · ×1
  • update_trusted_task_bundles.main (cognitive 24) hack/tools/scripts/update_trusted_task_bundles.py:492 — update_trusted_task_bundles.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3, boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawCreateOptions.Validate (cognitive 23) · ×1
  • RawCreateOptions.Validate (cognitive 23) cmd/cluster/kubevirt/create.go:74 — RawCreateOptions.Validate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 5, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.destroyPowerVsCloudInstance (cognitive 23) · ×1
  • powervs.destroyPowerVsCloudInstance (cognitive 23) cmd/infra/powervs/destroy.go:426 — powervs.destroyPowerVsCloudInstance has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 1 (2 pts) (nesting depth added 14). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 442). 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.
D2 · Cognitive Complexity · powervs.deleteCOS (cognitive 23) · ×1
  • powervs.deleteCOS (cognitive 23) cmd/infra/powervs/destroy.go:788 — powervs.deleteCOS has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.validateVpc (cognitive 23) · ×1
  • powervs.validateVpc (cognitive 23) cmd/infra/powervs/validate.go:107 — powervs.validateVpc has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 2, match/switch 1 (2 pts) (nesting depth added 6). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.RenderHyperShiftOperator (cognitive 23) · ×1
  • install.RenderHyperShiftOperator (cognitive 23) cmd/install/install_render.go:115 — install.RenderHyperShiftOperator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 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.
D2 · Cognitive Complexity · kas.ReconcileKonnectivityServerServiceStatus (cognitive 23) · ×1
  • kas.ReconcileKonnectivityServerServiceStatus (cognitive 23) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:421 — kas.ReconcileKonnectivityServerServiceStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · reconciler.reconcileMetricsForwarder (cognitive 23) · ×1
  • reconciler.reconcileMetricsForwarder (cognitive 23) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1040 — reconciler.reconcileMetricsForwarder has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reconciler.reconcileKubeletConfig (cognitive 23) · ×1
  • reconciler.reconcileKubeletConfig (cognitive 23) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2683 — reconciler.reconcileKubeletConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3, 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.
D2 · Cognitive Complexity · nodepool.isArchAndPlatformSupported (cognitive 23) · ×1
  • nodepool.isArchAndPlatformSupported (cognitive 23) hypershift-operator/controllers/nodepool/nodepool_controller.go:621 — nodepool.isArchAndPlatformSupported has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · nodepool.BuildMirrorConfigs (cognitive 23) · ×1
  • nodepool.BuildMirrorConfigs (cognitive 23) hypershift-operator/controllers/nodepool/nto.go:420 — nodepool.BuildMirrorConfigs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scheduler.nonRequestServingMachineSetsToScale (cognitive 23) · ×1
  • scheduler.nonRequestServingMachineSetsToScale (cognitive 23) hypershift-operator/controllers/scheduler/aws/autoscaler.go:831 — scheduler.nonRequestServingMachineSetsToScale has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · createOrUpdateProvider.CreateOrUpdate (cognitive 23) · ×1
  • createOrUpdateProvider.CreateOrUpdate (cognitive 23) support/upsert/upsert.go:68 — createOrUpdateProvider.CreateOrUpdate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 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.
D2 · Cognitive Complexity · main.main (cognitive 23) · ×1
  • main.main (cognitive 23) hack/tools/deployment/deployment-update.go:87 — main.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 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.
D2 · Cognitive Complexity · CreateIAMOptions.CreateIAM (cognitive 22) · ×1
  • CreateIAMOptions.CreateIAM (cognitive 22) cmd/infra/aws/create_iam.go:177 — CreateIAMOptions.CreateIAM has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · azure.convergePrivateDNSZoneLink (cognitive 22) · ×1
  • azure.convergePrivateDNSZoneLink (cognitive 22) cmd/infra/azure/networking.go:569 — azure.convergePrivateDNSZoneLink has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (22 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 579). 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.
D2 · Cognitive Complexity · install.WaitUntilAvailable (cognitive 22) · ×1
  • install.WaitUntilAvailable (cognitive 22) cmd/install/install.go:745 — install.WaitUntilAvailable has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 3 (nesting depth added 5). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 757, 792). 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileEtcdStatus (cognitive 22) · ×1
  • HostedControlPlaneReconciler.reconcileEtcdStatus (cognitive 22) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:513 — HostedControlPlaneReconciler.reconcileEtcdStatus has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1, match/switch 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.validateAzureKMSConfig (cognitive 22) · ×1
  • HostedControlPlaneReconciler.validateAzureKMSConfig (cognitive 22) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3765 — HostedControlPlaneReconciler.validateAzureKMSConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (21 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.setupKASClientSigners (cognitive 22) · ×1
  • HostedControlPlaneReconciler.setupKASClientSigners (cognitive 22) control-plane-operator/controllers/hostedcontrolplane/kas_pki_setup.go:19 — HostedControlPlaneReconciler.setupKASClientSigners has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · etcd.adaptShardStorage (cognitive 22) · ×1
  • etcd.adaptShardStorage (cognitive 22) control-plane-operator/controllers/hostedcontrolplane/v2/etcd/shard.go:265 — etcd.adaptShardStorage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, match/switch 1 (nesting depth added 11). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · HostedClusterConfigOperator.Run (cognitive 22) · ×1
  • HostedClusterConfigOperator.Run (cognitive 22) control-plane-operator/hostedclusterconfigoperator/cmd.go:223 — HostedClusterConfigOperator.Run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ProxyHandler.ServeHTTP (cognitive 22) · ×1
  • ProxyHandler.ServeHTTP (cognitive 22) control-plane-operator/metrics-proxy/proxy.go:36 — ProxyHandler.ServeHTTP has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.collectSeeds (cognitive 22) · ×1
  • main.collectSeeds (cognitive 22) REDACTED:923 — main.collectSeeds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.determineNodeCount (cognitive 22) · ×1
  • reconciler.determineNodeCount (cognitive 22) hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:492 — reconciler.determineNodeCount has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cachedBootImage.CacheImage (cognitive 22) · ×1
  • cachedBootImage.CacheImage (cognitive 22) hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:133 — cachedBootImage.CacheImage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.ensureVpcEndpointService (cognitive 22) · ×1
  • AWSEndpointServiceReconciler.ensureVpcEndpointService (cognitive 22) REDACTED:506 — AWSEndpointServiceReconciler.ensureVpcEndpointService has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 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.
D2 · Cognitive Complexity · MachineSetDescaler.Reconcile (cognitive 22) · ×1
  • MachineSetDescaler.Reconcile (cognitive 22) hypershift-operator/controllers/scheduler/aws/autoscaler.go:139 — MachineSetDescaler.Reconcile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · webhookcerts.EnsureLegacyServiceCAMigration (cognitive 22) · ×1
  • webhookcerts.EnsureLegacyServiceCAMigration (cognitive 22) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:412 — webhookcerts.EnsureLegacyServiceCAMigration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (WebhookCertReconciler.removeServiceCAResources) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · WebhookCertReconciler.removeServiceCAResources (cognitive 22) · ×1
  • WebhookCertReconciler.removeServiceCAResources (cognitive 22) hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:241 — WebhookCertReconciler.removeServiceCAResources has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (webhookcerts.EnsureLegacyServiceCAMigration) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · awsutil.CreatePublicHostedZone (cognitive 22) · ×1
  • awsutil.CreatePublicHostedZone (cognitive 22) support/awsutil/route53.go:231 — awsutil.CreatePublicHostedZone has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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.
D2 · Cognitive Complexity · awsutil.lookupPrivateZoneIDForVPC (cognitive 22) · ×1
  • awsutil.lookupPrivateZoneIDForVPC (cognitive 22) support/awsutil/route53.go:328 — awsutil.lookupPrivateZoneIDForVPC has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (6 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · aws.ensureBastionSecurityGroup (cognitive 21) · ×1
  • aws.ensureBastionSecurityGroup (cognitive 21) cmd/bastion/aws/create.go:213 — aws.ensureBastionSecurityGroup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 18 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.
D2 · Cognitive Complexity · RawCreateOptions.Validate (cognitive 21) · ×1
  • RawCreateOptions.Validate (cognitive 21) cmd/cluster/gcp/create.go:165 — RawCreateOptions.Validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · azure.collectMachineDiagnostics (cognitive 21) · ×1
  • azure.collectMachineDiagnostics (cognitive 21) cmd/consolelogs/azure/getlogs.go:141 — azure.collectMachineDiagnostics has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 6). Of this number, 17 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.
D2 · Cognitive Complexity · azure.VerifyArtifacts (cognitive 21) · ×1
  • azure.VerifyArtifacts (cognitive 21) cmd/consolelogs/azure/report.go:81 — azure.VerifyArtifacts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (5 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.
D2 · Cognitive Complexity · install.hyperShiftOperatorManifests (cognitive 21) · ×1
  • install.hyperShiftOperatorManifests (cognitive 21) cmd/install/install.go:855 — install.hyperShiftOperatorManifests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.listAllAssignments (cognitive 21) · ×1
  • main.listAllAssignments (cognitive 21) contrib/azure-orphaned-role-assignments/main.go:164 — main.listAllAssignments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.reconcileExternalNameServices (cognitive 21) · ×1
  • AWSEndpointServiceReconciler.reconcileExternalNameServices (cognitive 21) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1037 — AWSEndpointServiceReconciler.reconcileExternalNameServices has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 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.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileAzurePlatformCerts (cognitive 21) · ×1
  • HostedControlPlaneReconciler.reconcileAzurePlatformCerts (cognitive 21) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2136 — HostedControlPlaneReconciler.reconcileAzurePlatformCerts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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.
D2 · Cognitive Complexity · Reconciler.reconcileAPIServerServiceStatus (cognitive 21) · ×1
  • Reconciler.reconcileAPIServerServiceStatus (cognitive 21) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:519 — Reconciler.reconcileAPIServerServiceStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · oauth.ReconcileService (cognitive 21) · ×1
  • oauth.ReconcileService (cognitive 21) control-plane-operator/controllers/hostedcontrolplane/oauth/service.go:30 — oauth.ReconcileService has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oauth.ReconcileServiceStatus (cognitive 21) · ×1
  • oauth.ReconcileServiceStatus (cognitive 21) control-plane-operator/controllers/hostedcontrolplane/oauth/service.go:86 — oauth.ReconcileServiceStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · resources.Setup (cognitive 21) · ×1
  • resources.Setup (cognitive 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:183 — resources.Setup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 1 (nesting depth added 3). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
D2 · Cognitive Complexity · reconciler.reconcileCloudConfig (cognitive 21) · ×1
  • reconciler.reconcileCloudConfig (cognitive 21) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2196 — reconciler.reconcileCloudConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (nesting depth added 10). Of this number, 11 points are the body's own statements and 10 belong to 3 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CertificateRevocationController.generateNewSignerCertificate (cognitive 21) · ×1
  • CertificateRevocationController.generateNewSignerCertificate (cognitive 21) REDACTED:473 — CertificateRevocationController.generateNewSignerCertificate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HCPEtcdBackupReconciler.Reconcile (cognitive 21) · ×1
  • HCPEtcdBackupReconciler.Reconcile (cognitive 21) hypershift-operator/controllers/etcdbackup/reconciler.go:311 — HCPEtcdBackupReconciler.Reconcile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileCAPIFinalizers (cognitive 21) · ×1
  • HostedClusterReconciler.reconcileCAPIFinalizers (cognitive 21) REDACTED:6178 — HostedClusterReconciler.reconcileCAPIFinalizers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 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.
D2 · Cognitive Complexity · CAPI.listMachineTemplates (cognitive 21) · ×1
  • CAPI.listMachineTemplates (cognitive 21) hypershift-operator/controllers/nodepool/capi.go:1486 — CAPI.listMachineTemplates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1, match/switch 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.
D2 · Cognitive Complexity · NodePoolReconciler.reconcileMirroredConfigs (cognitive 21) · ×1
  • NodePoolReconciler.reconcileMirroredConfigs (cognitive 21) hypershift-operator/controllers/nodepool/nto.go:53 — NodePoolReconciler.reconcileMirroredConfigs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceController.Reconcile (cognitive 21) · ×1
  • AzurePrivateLinkServiceController.Reconcile (cognitive 21) hypershift-operator/controllers/platform/azure/controller.go:139 — AzurePrivateLinkServiceController.Reconcile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (21 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.runInit (cognitive 21) · ×1
  • main.runInit (cognitive 21) hypershift-operator/init.go:61 — main.runInit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 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.
D2 · Cognitive Complexity · konnectivityhttpsproxy.NewStartCommand (cognitive 21) · ×1
  • konnectivityhttpsproxy.NewStartCommand (cognitive 21) REDACTED:31 — konnectivityhttpsproxy.NewStartCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (21 pts) (nesting depth added 6). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 72). 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.
D2 · Cognitive Complexity · SharedIngressConfigReconciler.Reconcile (cognitive 21) · ×1
  • SharedIngressConfigReconciler.Reconcile (cognitive 21) sharedingress-config-generator/controller.go:101 — SharedIngressConfigReconciler.Reconcile has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · supportedversion.retrieveSupportedOCPVersion (cognitive 21) · ×1
  • supportedversion.retrieveSupportedOCPVersion (cognitive 21) support/supportedversion/version.go:482 — supportedversion.retrieveSupportedOCPVersion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · verify-tekton-pipeline-pairs.check_pair (cognitive 21) · ×1
  • verify-tekton-pipeline-pairs.check_pair (cognitive 21) hack/verify-tekton-pipeline-pairs.py:195 — verify-tekton-pipeline-pairs.check_pair has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DrOidcIamOptions.Run (cognitive 20) · ×1
  • DrOidcIamOptions.Run (cognitive 20) REDACTED:388 — DrOidcIamOptions.Run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · aws.emptyBucket (cognitive 20) · ×1
  • aws.emptyBucket (cognitive 20) cmd/infra/aws/destroy.go:330 — aws.emptyBucket has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyInfra (cognitive 20) · ×1
  • DestroyInfraOptions.DestroyInfra (cognitive 20) cmd/infra/aws/destroy.go:192 — DestroyInfraOptions.DestroyInfra has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (19 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyVPCEndpointServices (cognitive 20) · ×1
  • DestroyInfraOptions.DestroyVPCEndpointServices (cognitive 20) cmd/infra/aws/destroy.go:475 — DestroyInfraOptions.DestroyVPCEndpointServices has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (7 pts), jumps 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyInternetGateways (cognitive 20) · ×1
  • DestroyInfraOptions.DestroyInternetGateways (cognitive 20) cmd/infra/aws/destroy.go:702 — DestroyInfraOptions.DestroyInternetGateways has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyIAMOptions.DestroyOIDCResources (cognitive 20) · ×1
  • DestroyIAMOptions.DestroyOIDCResources (cognitive 20) cmd/infra/aws/destroy_iam.go:126 — DestroyIAMOptions.DestroyOIDCResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DestroyIAMOptions.DestroyOIDCRole (cognitive 20) · ×1
  • DestroyIAMOptions.DestroyOIDCRole (cognitive 20) cmd/infra/aws/destroy_iam.go:215 — DestroyIAMOptions.DestroyOIDCRole has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.validateTransitGatewayByName (cognitive 20) · ×1
  • powervs.validateTransitGatewayByName (cognitive 20) cmd/infra/powervs/validate.go:167 — powervs.validateTransitGatewayByName has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, loops 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · kubeconfig.Render (cognitive 20) · ×1
  • kubeconfig.Render (cognitive 20) cmd/kubeconfig/create.go:84 — kubeconfig.Render has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, match/switch 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.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.deduplicateSubnetsByAZ (cognitive 20) · ×1
  • AWSEndpointServiceReconciler.deduplicateSubnetsByAZ (cognitive 20) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:624 — AWSEndpointServiceReconciler.deduplicateSubnetsByAZ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (8 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.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.ensureIPAddress (cognitive 20) · ×1
  • GCPPrivateServiceConnectReconciler.ensureIPAddress (cognitive 20) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:641 — GCPPrivateServiceConnectReconciler.ensureIPAddress has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 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.
D2 · Cognitive Complexity · clusterVersionOperator.adaptDeployment (cognitive 20) · ×1
  • clusterVersionOperator.adaptDeployment (cognitive 20) control-plane-operator/controllers/hostedcontrolplane/v2/cvo/deployment.go:36 — clusterVersionOperator.adaptDeployment has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1 (nesting depth added 5). Of this number, 10 points are the body's own statements and 10 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.
D2 · Cognitive Complexity · kas.deriveAESCBCEncryptionConfig (cognitive 20) · ×1
  • kas.deriveAESCBCEncryptionConfig (cognitive 20) control-plane-operator/controllers/hostedcontrolplane/v2/kas/secretencryption.go:119 — kas.deriveAESCBCEncryptionConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configuration.ReconcileGlobal (cognitive 20) · ×1
  • configuration.ReconcileGlobal (cognitive 20) control-plane-operator/hostedclusterconfigoperator/controllers/resources/configuration/global.go:18 — configuration.ReconcileGlobal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17 (20 pts) (nesting depth added 3). 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, 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.
D2 · Cognitive Complexity · hostedcluster.deleteAWSEndpointServices (cognitive 20) · ×1
  • hostedcluster.deleteAWSEndpointServices (cognitive 20) REDACTED:3964 — hostedcluster.deleteAWSEndpointServices has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, 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.
D2 · Cognitive Complexity · hostedClusterDefaulter.Default (cognitive 20) · ×1
  • hostedClusterDefaulter.Default (cognitive 20) hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go:34 — hostedClusterDefaulter.Default has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), match/switch 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.
D2 · Cognitive Complexity · reconciler.Reconcile (cognitive 20) · ×1
  • reconciler.Reconcile (cognitive 20) hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:125 — reconciler.Reconcile has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (20 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.
D2 · Cognitive Complexity · CAPI.cleanupMachineTemplates (cognitive 20) · ×1
  • CAPI.cleanupMachineTemplates (cognitive 20) hypershift-operator/controllers/nodepool/capi.go:263 — CAPI.cleanupMachineTemplates has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Token.cleanupOutdated (cognitive 20) · ×1
  • Token.cleanupOutdated (cognitive 20) hypershift-operator/controllers/nodepool/token.go:243 — Token.cleanupOutdated has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6 (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.
D2 · Cognitive Complexity · Token.resolveEffectiveHash (cognitive 20) · ×1
  • Token.resolveEffectiveHash (cognitive 20) hypershift-operator/controllers/nodepool/token.go:430 — Token.resolveEffectiveHash has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.delete (cognitive 20) · ×1
  • AWSEndpointServiceReconciler.delete (cognitive 20) REDACTED:685 — AWSEndpointServiceReconciler.delete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 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.
D2 · Cognitive Complexity · machineSizesCache.updateSizesFromMachineSets (cognitive 20) · ×1
  • machineSizesCache.updateSizesFromMachineSets (cognitive 20) hypershift-operator/controllers/resourcebasedcpautoscaler/machine_sizes_cache.go:126 — machineSizesCache.updateSizesFromMachineSets has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (nesting depth added 8). Of this number, 17 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.
D2 · Cognitive Complexity · controlPlaneWorkload.setControlPlaneIsolation (cognitive 20) · ×1
  • controlPlaneWorkload.setControlPlaneIsolation (cognitive 20) support/controlplane-component/defaults.go:278 — controlPlaneWorkload.setControlPlaneIsolation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 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.
D2 · Cognitive Complexity · CincinnatiVersionResolver.fetchVersion (cognitive 20) · ×1
  • CincinnatiVersionResolver.fetchVersion (cognitive 20) support/releaseinfo/cincinnati_version_resolver.go:110 — CincinnatiVersionResolver.fetchVersion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 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.
D2 · Cognitive Complexity · supportedversion.IsValidReleaseVersion (cognitive 20) · ×1
  • supportedversion.IsValidReleaseVersion (cognitive 20) support/supportedversion/version.go:136 — supportedversion.IsValidReleaseVersion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · upsert.defaultContainer (cognitive 20) · ×1
  • upsert.defaultContainer (cognitive 20) support/upsert/upsert.go:360 — upsert.defaultContainer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 2, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · applyProvider.ApplyManifest (cognitive 20) · ×1
  • applyProvider.ApplyManifest (cognitive 20) support/upsert/apply.go:71 — applyProvider.ApplyManifest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 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.
D2 · Cognitive Complexity · PRReportGenerator._process_pr_data (cognitive 20) · ×1
  • PRReportGenerator._process_pr_data (cognitive 20) contrib/repo_metrics/weekly_pr_report.py:819 — PRReportGenerator._process_pr_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts), boolean chains 2, ternaries 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.
D2 · Cognitive Complexity · PRReportGenerator.save_summary_data (cognitive 20) · ×1
  • PRReportGenerator.save_summary_data (cognitive 20) contrib/repo_metrics/weekly_pr_report.py:1401 — PRReportGenerator.save_summary_data has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (4 pts), ternaries 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.
D2 · Cognitive Complexity · PRReportGenerator.score_prs_for_deep_analysis (cognitive 20) · ×1
  • PRReportGenerator.score_prs_for_deep_analysis (cognitive 20) contrib/repo_metrics/weekly_pr_report.py:1870 — PRReportGenerator.score_prs_for_deep_analysis has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · weekly_pr_report.main (cognitive 20) · ×1
  • weekly_pr_report.main (cognitive 20) contrib/repo_metrics/weekly_pr_report.py:2212 — weekly_pr_report.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · loader.Resolve (cognitive 19) · ×1
  • loader.Resolve (cognitive 19) contrib/gomaxprocs-webhook/internal/config/loader.go:45 — loader.Resolve has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dump.dumpGuestCluster (cognitive 19) · ×1
  • dump.dumpGuestCluster (cognitive 19) REDACTED:308 — dump.dumpGuestCluster has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 pts) (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · CreateOptions.ApplyPlatformSpecifics (cognitive 19) · ×1
  • CreateOptions.ApplyPlatformSpecifics (cognitive 19) cmd/cluster/kubevirt/create.go:182 — CreateOptions.ApplyPlatformSpecifics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DrOidcIamOptions.extractFromHostedCluster (cognitive 19) · ×1
  • DrOidcIamOptions.extractFromHostedCluster (cognitive 19) REDACTED:269 — DrOidcIamOptions.extractFromHostedCluster has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreateInfraOptions.createNetworkResources (cognitive 19) · ×1
  • CreateInfraOptions.createNetworkResources (cognitive 19) cmd/infra/azure/create.go:169 — CreateInfraOptions.createNetworkResources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.getServiceInfo (cognitive 19) · ×1
  • powervs.getServiceInfo (cognitive 19) cmd/infra/powervs/create.go:608 — powervs.getServiceInfo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.apply (cognitive 19) · ×1
  • install.apply (cognitive 19) cmd/install/install.go:683 — install.apply has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · Options.validateExternalDNSConfig (cognitive 19) · ×1
  • Options.validateExternalDNSConfig (cognitive 19) cmd/install/install.go:303 — Options.validateExternalDNSConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · kubeconfig.buildCombinedConfig (cognitive 19) · ×1
  • kubeconfig.buildCombinedConfig (cognitive 19) cmd/kubeconfig/create.go:147 — kubeconfig.buildCombinedConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateOptions.validateCluster (cognitive 19) · ×1
  • CreateOptions.validateCluster (cognitive 19) cmd/oadp/restore.go:160 — CreateOptions.validateCluster 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.
D2 · Cognitive Complexity · AWSEndpointServiceReconciler.deleteSecurityGroup (cognitive 19) · ×1
  • AWSEndpointServiceReconciler.deleteSecurityGroup (cognitive 19) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1411 — AWSEndpointServiceReconciler.deleteSecurityGroup 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.
D2 · Cognitive Complexity · azureprivatelinkservice.baseDomainFromServices (cognitive 19) · ×1
  • azureprivatelinkservice.baseDomainFromServices (cognitive 19) control-plane-operator/controllers/azureprivatelinkservice/observer.go:192 — azureprivatelinkservice.baseDomainFromServices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (16 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileOLMAndMiscCerts (cognitive 19) · ×1
  • HostedControlPlaneReconciler.reconcileOLMAndMiscCerts (cognitive 19) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1888 — HostedControlPlaneReconciler.reconcileOLMAndMiscCerts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 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.
D2 · Cognitive Complexity · Reconciler.ReconcileInfrastructureStatus (cognitive 19) · ×1
  • Reconciler.ReconcileInfrastructureStatus (cognitive 19) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:115 — Reconciler.ReconcileInfrastructureStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (19 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · kas.ReconcileServiceStatus (cognitive 19) · ×1
  • kas.ReconcileServiceStatus (cognitive 19) control-plane-operator/controllers/hostedcontrolplane/kas/service.go:183 — kas.ReconcileServiceStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · cno.checkOperandsRolloutStatus (cognitive 19) · ×1
  • cno.checkOperandsRolloutStatus (cognitive 19) control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:103 — cno.checkOperandsRolloutStatus has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reconciler.Reconcile (cognitive 19) · ×1
  • reconciler.Reconcile (cognitive 19) control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:33 — reconciler.Reconcile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CertificateRevocationController.syncCertificateRevocationRequest (cognitive 19) · ×1
  • CertificateRevocationController.syncCertificateRevocationRequest (cognitive 19) REDACTED:322 — CertificateRevocationController.syncCertificateRevocationRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CertificateRevocationController.verifyCertificateAgainstAllKASPods (cognitive 19) · ×1
  • CertificateRevocationController.verifyCertificateAgainstAllKASPods (cognitive 19) REDACTED:595 — CertificateRevocationController.verifyCertificateAgainstAllKASPods has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.removeUnusedImports (cognitive 19) · ×1
  • main.removeUnusedImports (cognitive 19) REDACTED:738 — main.removeUnusedImports has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigMapWebhookHandler.Handle (cognitive 19) · ×1
  • ConfigMapWebhookHandler.Handle (cognitive 19) hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:44 — ConfigMapWebhookHandler.Handle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · HostedClusterReconciler.validateAWSConfig (cognitive 19) · ×1
  • HostedClusterReconciler.validateAWSConfig (cognitive 19) REDACTED:4717 — HostedClusterReconciler.validateAWSConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · haproxy.shouldSkipProxyForKAS (cognitive 19) · ×1
  • haproxy.shouldSkipProxyForKAS (cognitive 19) hypershift-operator/controllers/nodepool/apiserver-haproxy/haproxy.go:376 — haproxy.shouldSkipProxyForKAS has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfigGenerator.doParse (cognitive 19) · ×1
  • ConfigGenerator.doParse (cognitive 19) hypershift-operator/controllers/nodepool/config.go:389 — ConfigGenerator.doParse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodePoolReconciler.deleteKubeVirtCache (cognitive 19) · ×1
  • NodePoolReconciler.deleteKubeVirtCache (cognitive 19) hypershift-operator/controllers/nodepool/nodepool_controller.go:731 — NodePoolReconciler.deleteKubeVirtCache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.Reconcile (cognitive 19) · ×1
  • GCPPrivateServiceConnectReconciler.Reconcile (cognitive 19) hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:155 — GCPPrivateServiceConnectReconciler.Reconcile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 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.
D2 · Cognitive Complexity · DedicatedServingComponentSchedulerAndSizer.backfillOrClaimNodes (cognitive 19) · ×1
  • DedicatedServingComponentSchedulerAndSizer.backfillOrClaimNodes (cognitive 19) REDACTED:565 — DedicatedServingComponentSchedulerAndSizer.backfillOrClaimNodes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EtcdClientPool.Get (cognitive 19) · ×1
  • EtcdClientPool.Get (cognitive 19) pkg/etcdcli/etcdcli_pool.go:48 — EtcdClientPool.Get has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · konnectivityproxy.resolveAllIPs (cognitive 19) · ×1
  • konnectivityproxy.resolveAllIPs (cognitive 19) support/konnectivityproxy/resolver.go:260 — konnectivityproxy.resolveAllIPs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proxy.DefaultNoProxy (cognitive 19) · ×1
  • proxy.DefaultNoProxy (cognitive 19) support/proxy/no_proxy.go:16 — proxy.DefaultNoProxy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), match/switch 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.
D2 · Cognitive Complexity · guestcluster.run (cognitive 19) · ×1
  • guestcluster.run (cognitive 19) hack/tools/hypershiftlinter/analyzers/guestcluster/guestcluster.go:20 — guestcluster.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). Of this number, 12 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate_ownership.top_level_group (cognitive 19) · ×1
  • generate_ownership.top_level_group (cognitive 19) skills/restructure-commits/generate_ownership.py:185 — generate_ownership.top_level_group has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.parseEtcdShardResources (cognitive 18) · ×1
  • core.parseEtcdShardResources (cognitive 18) cmd/cluster/core/etcd_shards.go:179 — core.parseEtcdShardResources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dump.gatherNetworkLogs (cognitive 18) · ×1
  • dump.gatherNetworkLogs (cognitive 18) REDACTED:814 — dump.gatherNetworkLogs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateInfraOptions.CreatePrivateZone (cognitive 18) · ×1
  • CreateInfraOptions.CreatePrivateZone (cognitive 18) cmd/infra/aws/route53.go:76 — CreateInfraOptions.CreatePrivateZone has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyVPCs (cognitive 18) · ×1
  • DestroyInfraOptions.DestroyVPCs (cognitive 18) cmd/infra/aws/destroy.go:764 — DestroyInfraOptions.DestroyVPCs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HyperShiftOperatorDeployment.buildEnvVars (cognitive 18) · ×1
  • HyperShiftOperatorDeployment.buildEnvVars (cognitive 18) cmd/install/assets/hypershift_operator.go:832 — HyperShiftOperatorDeployment.buildEnvVars has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · install.render (cognitive 18) · ×1
  • install.render (cognitive 18) cmd/install/install_render.go:310 — install.render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · util.apply (cognitive 18) · ×1
  • util.apply (cognitive 18) cmd/util/params.go:119 — util.apply has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.selectCandidates (cognitive 18) · ×1
  • main.selectCandidates (cognitive 18) contrib/azure-orphaned-role-assignments/main.go:212 — main.selectCandidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azureprivatelinkservice.extractPrivateEndpointIP (cognitive 18) · ×1
  • azureprivatelinkservice.extractPrivateEndpointIP (cognitive 18) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1271 — azureprivatelinkservice.extractPrivateEndpointIP has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hostedcontrolplane.createAWSDefaultSecurityGroup (cognitive 18) · ×1
  • hostedcontrolplane.createAWSDefaultSecurityGroup (cognitive 18) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3365 — hostedcontrolplane.createAWSDefaultSecurityGroup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileEtcdCerts (cognitive 18) · ×1
  • HostedControlPlaneReconciler.reconcileEtcdCerts (cognitive 18) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1608 — HostedControlPlaneReconciler.reconcileEtcdCerts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ignitionserver.adaptServingCertSecret (cognitive 18) · ×1
  • ignitionserver.adaptServingCertSecret (cognitive 18) control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/pki.go:38 — ignitionserver.adaptServingCertSecret has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ignitionserverproxy.adaptHAProxyConfig (cognitive 18) · ×1
  • ignitionserverproxy.adaptHAProxyConfig (cognitive 18) control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver_proxy/deployment.go:58 — ignitionserverproxy.adaptHAProxyConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputResourceInitializer.checkSupportedInputResources (cognitive 18) · ×1
  • inputResourceInitializer.checkSupportedInputResources (cognitive 18) control-plane-operator/controllers/openshiftmanager/input_resource_initializer.go:69 — inputResourceInitializer.checkSupportedInputResources has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 9 points are the body's own statements and 9 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.
D2 · Cognitive Complexity · metricsproxy.buildTLSConfigFromFiles (cognitive 18) · ×1
  • metricsproxy.buildTLSConfigFromFiles (cognitive 18) control-plane-operator/metrics-proxy/config_reader.go:104 — metricsproxy.buildTLSConfigFromFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · etcdrecovery.checkEtcdStatus (cognitive 18) · ×1
  • etcdrecovery.checkEtcdStatus (cognitive 18) REDACTED:292 — etcdrecovery.checkEtcdStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PodWebhookHandler.Handle (cognitive 18) · ×1
  • PodWebhookHandler.Handle (cognitive 18) hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:50 — PodWebhookHandler.Handle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SnapshotReconciler.manageRetention (cognitive 18) · ×1
  • SnapshotReconciler.manageRetention (cognitive 18) hypershift-operator/controllers/auditlogpersistence/snapshot_controller.go:264 — SnapshotReconciler.manageRetention has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 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.
D2 · Cognitive Complexity · HostedClusterReconciler.handleExistingEtcdRecoveryJob (cognitive 18) · ×1
  • HostedClusterReconciler.handleExistingEtcdRecoveryJob (cognitive 18) hypershift-operator/controllers/hostedcluster/etcd_recovery.go:71 — HostedClusterReconciler.handleExistingEtcdRecoveryJob has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileAWSOIDCDocuments (cognitive 18) · ×1
  • HostedClusterReconciler.reconcileAWSOIDCDocuments (cognitive 18) REDACTED:5354 — HostedClusterReconciler.reconcileAWSOIDCDocuments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gcp.ComputeGCPCredentialConditions (cognitive 18) · ×1
  • gcp.ComputeGCPCredentialConditions (cognitive 18) hypershift-operator/controllers/hostedcluster/internal/platform/gcp/gcp.go:530 — gcp.ComputeGCPCredentialConditions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · ignitionpayload.parse (cognitive 18) · ×1
  • ignitionpayload.parse (cognitive 18) hypershift-operator/controllers/ignitionpayload/config.go:94 — ignitionpayload.parse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CAPI.propagateLabelsAndTaintsToMachines (cognitive 18) · ×1
  • CAPI.propagateLabelsAndTaintsToMachines (cognitive 18) hypershift-operator/controllers/nodepool/capi.go:574 — CAPI.propagateLabelsAndTaintsToMachines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 585). 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.
D2 · Cognitive Complexity · NodePoolReconciler.setAllNodesHealthyCondition (cognitive 18) · ×1
  • NodePoolReconciler.setAllNodesHealthyCondition (cognitive 18) hypershift-operator/controllers/nodepool/conditions.go:729 — NodePoolReconciler.setAllNodesHealthyCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 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.
D2 · Cognitive Complexity · scheduler.hostedClusterMachineSetsToScaleDown (cognitive 18) · ×1
  • scheduler.hostedClusterMachineSetsToScaleDown (cognitive 18) hypershift-operator/controllers/scheduler/aws/autoscaler.go:239 — scheduler.hostedClusterMachineSetsToScaleDown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 2 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.
D2 · Cognitive Complexity · Reconciler.SetupWithManager (cognitive 18) · ×1
  • Reconciler.SetupWithManager (cognitive 18) karpenter-operator/controllers/karpenter/karpenter_controller.go:77 — Reconciler.SetupWithManager has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1. Of this number, 10 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · nodeclass.setAWSResourceTagConflictCondition (cognitive 18) · ×1
  • nodeclass.setAWSResourceTagConflictCondition (cognitive 18) karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:811 — nodeclass.setAWSResourceTagConflictCondition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · controlPlaneWorkload.applyRequestsOverrides (cognitive 18) · ×1
  • controlPlaneWorkload.applyRequestsOverrides (cognitive 18) support/controlplane-component/defaults.go:488 — controlPlaneWorkload.applyRequestsOverrides has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · globalconfig.getImageContentSourcePolicies (cognitive 18) · ×1
  • globalconfig.getImageContentSourcePolicies (cognitive 18) support/globalconfig/imagecontentsource.go:159 — globalconfig.getImageContentSourcePolicies 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.
D2 · Cognitive Complexity · globalconfig.ReconcileNetworkConfig (cognitive 18) · ×1
  • globalconfig.ReconcileNetworkConfig (cognitive 18) support/globalconfig/network.go:31 — globalconfig.ReconcileNetworkConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
D2 · Cognitive Complexity · oadp.VerifyDPAStatus (cognitive 18) · ×1
  • oadp.VerifyDPAStatus (cognitive 18) support/oadp/validate.go:64 — oadp.VerifyDPAStatus has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GlobalPullSecretSyncer.checkAndFixFile (cognitive 18) · ×1
  • GlobalPullSecretSyncer.checkAndFixFile (cognitive 18) sync-global-pullsecret/sync-global-pullsecret.go:200 — GlobalPullSecretSyncer.checkAndFixFile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 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.
D2 · Cognitive Complexity · main.updateTagAndCommitSHA (cognitive 18) · ×1
  • main.updateTagAndCommitSHA (cognitive 18) hack/tools/deployment/deployment-update.go:220 — main.updateTagAndCommitSHA has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 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.
D2 · Cognitive Complexity · PRReportGenerator.fetch_prs_graphql (cognitive 18) · ×1
  • PRReportGenerator.fetch_prs_graphql (cognitive 18) contrib/repo_metrics/weekly_pr_report.py:529 — PRReportGenerator.fetch_prs_graphql has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ho_release_gate.evaluate_gate (cognitive 18) · ×1
  • ho_release_gate.evaluate_gate (cognitive 18) .tekton/lib/ho_release_gate.py:330 — ho_release_gate.evaluate_gate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · configrefs.authenticationSecretRefs (cognitive 17) · ×1
  • configrefs.authenticationSecretRefs (cognitive 17) api/util/configrefs/refs.go:67 — configrefs.authenticationSecretRefs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 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.
D2 · Cognitive Complexity · loader.getConfig (cognitive 17) · ×1
  • loader.getConfig (cognitive 17) contrib/gomaxprocs-webhook/internal/config/loader.go:86 — loader.getConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawCreateOptions.Validate (cognitive 17) · ×1
  • RawCreateOptions.Validate (cognitive 17) REDACTED:116 — RawCreateOptions.Validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · azure.collectSerialConsoleLog (cognitive 17) · ×1
  • azure.collectSerialConsoleLog (cognitive 17) cmd/consolelogs/azure/getlogs.go:217 — azure.collectSerialConsoleLog has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 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.
D2 · Cognitive Complexity · DrOidcIamOptions.ensureOIDCBucket (cognitive 17) · ×1
  • DrOidcIamOptions.ensureOIDCBucket (cognitive 17) REDACTED:712 — DrOidcIamOptions.ensureOIDCBucket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · install.openshiftTemplate (cognitive 17) · ×1
  • install.openshiftTemplate (cognitive 17) cmd/install/install_render.go:186 — install.openshiftTemplate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oadp.validateList (cognitive 17) · ×1
  • oadp.validateList (cognitive 17) cmd/oadp/schedule.go:400 — oadp.validateList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GCPPrivateServiceConnectReconciler.reconcileDNS (cognitive 17) · ×1
  • GCPPrivateServiceConnectReconciler.reconcileDNS (cognitive 17) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:324 — GCPPrivateServiceConnectReconciler.reconcileDNS has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HostedControlPlaneReconciler.reconcileAWSPlatformCerts (cognitive 17) · ×1
  • HostedControlPlaneReconciler.reconcileAWSPlatformCerts (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2052 — HostedControlPlaneReconciler.reconcileAWSPlatformCerts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 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.
D2 · Cognitive Complexity · Reconciler.AdmitHCPManagedRoutes (cognitive 17) · ×1
  • Reconciler.AdmitHCPManagedRoutes (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:174 — Reconciler.AdmitHCPManagedRoutes 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.
D2 · Cognitive Complexity · aws.adaptConfig (cognitive 17) · ×1
  • aws.adaptConfig (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/config.go:20 — aws.adaptConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KarpenterOperatorOptions.adaptStandaloneDeployment (cognitive 17) · ×1
  • KarpenterOperatorOptions.adaptStandaloneDeployment (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/deployment.go:104 — KarpenterOperatorOptions.adaptStandaloneDeployment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 5). Of this number, 14 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.
D2 · Cognitive Complexity · kas.checkExternalOIDCWebhookMigration (cognitive 17) · ×1
  • kas.checkExternalOIDCWebhookMigration (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/v2/kas/component.go:187 — kas.checkExternalOIDCWebhookMigration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · metricsproxy.collectSecretOrConfigMapRef (cognitive 17) · ×1
  • metricsproxy.collectSecretOrConfigMapRef (cognitive 17) control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/deployment.go:168 — metricsproxy.collectSecretOrConfigMapRef has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 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.
D2 · Cognitive Complexity · reconciler.Reconcile (cognitive 17) · ×1
  • reconciler.Reconcile (cognitive 17) control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go:41 — reconciler.Reconcile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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.
D2 · Cognitive Complexity · configuration.ReconcileObserved (cognitive 17) · ×1
  • configuration.ReconcileObserved (cognitive 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/configuration/observed.go:16 — configuration.ReconcileObserved has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1, loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 34). 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.
D2 · Cognitive Complexity · gcp.reconcileGCPCredentials (cognitive 17) · ×1
  • gcp.reconcileGCPCredentials (cognitive 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp/gcp.go:77 — gcp.reconcileGCPCredentials has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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.
D2 · Cognitive Complexity · resources.cleanupResources (cognitive 17) · ×1
  • resources.cleanupResources (cognitive 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:3086 — resources.cleanupResources 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.
D2 · Cognitive Complexity · ingress.ReconcileDefaultIngressController (cognitive 17) · ×1
  • ingress.ReconcileDefaultIngressController (cognitive 17) control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/reconcile.go:16 — ingress.ReconcileDefaultIngressController has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.writeLocalizedPackage (cognitive 17) · ×1
  • main.writeLocalizedPackage (cognitive 17) REDACTED:1181 — main.writeLocalizedPackage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (5 pts) (nesting depth added 5). Of this number, 16 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.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileGCPOIDCDocuments (cognitive 17) · ×1
  • HostedClusterReconciler.reconcileGCPOIDCDocuments (cognitive 17) hypershift-operator/controllers/hostedcluster/gcp_oidc.go:25 — HostedClusterReconciler.reconcileGCPOIDCDocuments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileGlobalConfigSync (cognitive 17) · ×1
  • HostedClusterReconciler.reconcileGlobalConfigSync (cognitive 17) REDACTED:2443 — HostedClusterReconciler.reconcileGlobalConfigSync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileKubeadminPasswordSync (cognitive 17) · ×1
  • HostedClusterReconciler.reconcileKubeadminPasswordSync (cognitive 17) REDACTED:2573 — HostedClusterReconciler.reconcileKubeadminPasswordSync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (2 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.validateConfigAndClusterCapabilities (cognitive 17) · ×1
  • HostedClusterReconciler.validateConfigAndClusterCapabilities (cognitive 17) REDACTED:4506 — HostedClusterReconciler.validateConfigAndClusterCapabilities has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 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.
D2 · Cognitive Complexity · AWS.CAPIProviderDeploymentSpec (cognitive 17) · ×1
  • AWS.CAPIProviderDeploymentSpec (cognitive 17) hypershift-operator/controllers/hostedcluster/internal/platform/aws/aws.go:105 — AWS.CAPIProviderDeploymentSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Azure.DeleteOrphanedMachines (cognitive 17) · ×1
  • Azure.DeleteOrphanedMachines (cognitive 17) hypershift-operator/controllers/hostedcluster/internal/platform/azure/azure.go:386 — Azure.DeleteOrphanedMachines 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.
D2 · Cognitive Complexity · CAPI.reconcileMachineHealthCheck (cognitive 17) · ×1
  • CAPI.reconcileMachineHealthCheck (cognitive 17) hypershift-operator/controllers/nodepool/capi.go:878 — CAPI.reconcileMachineHealthCheck has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D2 · Cognitive Complexity · kubevirt.PlatformValidation (cognitive 17) · ×1
  • kubevirt.PlatformValidation (cognitive 17) hypershift-operator/controllers/nodepool/kubevirt/kubevirt.go:137 — kubevirt.PlatformValidation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NodePoolReconciler.setAWSConditions (cognitive 17) · ×1
  • NodePoolReconciler.setAWSConditions (cognitive 17) hypershift-operator/controllers/nodepool/aws.go:460 — NodePoolReconciler.setAWSConditions 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.
D2 · Cognitive Complexity · NodePoolReconciler.setKubevirtConditions (cognitive 17) · ×1
  • NodePoolReconciler.setKubevirtConditions (cognitive 17) hypershift-operator/controllers/nodepool/kubevirt.go:35 — NodePoolReconciler.setKubevirtConditions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · Token.reconcileTokenSecret (cognitive 17) · ×1
  • Token.reconcileTokenSecret (cognitive 17) hypershift-operator/controllers/nodepool/token.go:584 — Token.reconcileTokenSecret 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.
D2 · Cognitive Complexity · main.setupSupportControllers (cognitive 17) · ×1
  • main.setupSupportControllers (cognitive 17) hypershift-operator/main.go:989 — main.setupSupportControllers 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.
D2 · Cognitive Complexity · cmd.run (cognitive 17) · ×1
  • cmd.run (cognitive 17) REDACTED:216 — cmd.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2 (nesting depth added 1). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 246, 235, 324). 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.
D2 · Cognitive Complexity · Reconciler.Reconcile (cognitive 17) · ×1
  • Reconciler.Reconcile (cognitive 17) karpenter-operator/controllers/karpenter/karpenter_controller.go:219 — Reconciler.Reconcile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · main.waitForKarpenterCRDs (cognitive 17) · ×1
  • main.waitForKarpenterCRDs (cognitive 17) karpenter-operator/crd_wait.go:21 — main.waitForKarpenterCRDs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 46). 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.
D2 · Cognitive Complexity · globalconfig.defaultProxyStatus (cognitive 17) · ×1
  • globalconfig.defaultProxyStatus (cognitive 17) support/globalconfig/proxy.go:71 — globalconfig.defaultProxyStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · imageregistry.LookupMappedImage (cognitive 17) · ×1
  • imageregistry.LookupMappedImage (cognitive 17) support/imageregistry/imagemapping.go:21 — imageregistry.LookupMappedImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · secretencryption.KeyStatusFromSpec (cognitive 17) · ×1
  • secretencryption.KeyStatusFromSpec (cognitive 17) support/secretencryption/keystatus.go:48 — secretencryption.KeyStatusFromSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JiraClient._parse_issue (cognitive 17) · ×1
  • JiraClient._parse_issue (cognitive 17) contrib/repo_metrics/weekly_pr_report.py:182 — JiraClient._parse_issue has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), ternaries 3, error handling 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · JiraClient._build_hierarchy_dict (cognitive 17) · ×1
  • JiraClient._build_hierarchy_dict (cognitive 17) contrib/repo_metrics/weekly_pr_report.py:329 — JiraClient._build_hierarchy_dict has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TrustedTasksData.get_latest_trusted (cognitive 17) · ×1
  • TrustedTasksData.get_latest_trusted (cognitive 17) hack/tools/scripts/update_trusted_task_bundles.py:99 — TrustedTasksData.get_latest_trusted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (7 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.
D2 · Cognitive Complexity · aws.getEC2Instances (cognitive 16) · ×1
  • aws.getEC2Instances (cognitive 16) cmd/consolelogs/aws/getlogs.go:112 — aws.getEC2Instances has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 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.
D2 · Cognitive Complexity · CreateInfraOptions.CreatePrivateRouteTable (cognitive 16) · ×1
  • CreateInfraOptions.CreatePrivateRouteTable (cognitive 16) cmd/infra/aws/ec2.go:424 — CreateInfraOptions.CreatePrivateRouteTable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · aws.APIsByDelegatedServices (cognitive 16) · ×1
  • aws.APIsByDelegatedServices (cognitive 16) cmd/infra/aws/iam_policies.go:21 — aws.APIsByDelegatedServices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 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.
D2 · Cognitive Complexity · DestroyInfraOptions.DestroyS3Buckets (cognitive 16) · ×1
  • DestroyInfraOptions.DestroyS3Buckets (cognitive 16) cmd/infra/aws/destroy.go:295 — DestroyInfraOptions.DestroyS3Buckets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · azure.assessVirtualNetworkLinkStates (cognitive 16) · ×1
  • azure.assessVirtualNetworkLinkStates (cognitive 16) cmd/infra/azure/networking.go:396 — azure.assessVirtualNetworkLinkStates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, match/switch 2 (4 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IAMManager.retryWithExponentialBackoff (cognitive 16) · ×1
  • IAMManager.retryWithExponentialBackoff (cognitive 16) REDACTED:817 — IAMManager.retryWithExponentialBackoff has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powervs.destroyVpc (cognitive 16) · ×1
  • powervs.destroyVpc (cognitive 16) cmd/infra/powervs/destroy.go:471 — powervs.destroyVpc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, loops 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 481). 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.
D2 · Cognitive Complexity · powervs.destroyVpcSubnet (cognitive 16) · ×1
  • powervs.destroyVpcSubnet (cognitive 16) cmd/infra/powervs/destroy.go:525 — powervs.destroyVpcSubnet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 530). 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.
D2 · Cognitive Complexity · Infra.setupPowerVSDHCP (cognitive 16) · ×1
  • Infra.setupPowerVSDHCP (cognitive 16) cmd/infra/powervs/create.go:1122 — Infra.setupPowerVSDHCP has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateNodePoolOptions.CreateNodePool (cognitive 16) · ×1
  • CreateNodePoolOptions.CreateNodePool (cognitive 16) cmd/nodepool/core/create.go:99 — CreateNodePoolOptions.CreateNodePool has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RawKubevirtPlatformCreateOptions.Validate (cognitive 16) · ×1
  • RawKubevirtPlatformCreateOptions.Validate (cognitive 16) cmd/nodepool/kubevirt/create.go:96 — RawKubevirtPlatformCreateOptions.Validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ValidatedKubevirtPlatformCreateOptions.Complete (cognitive 16) · ×1
  • ValidatedKubevirtPlatformCreateOptions.Complete (cognitive 16) cmd/nodepool/kubevirt/create.go:170 — ValidatedKubevirtPlatformCreateOptions.Complete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2, match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CompletedKubevirtPlatformCreateOptions.NodePoolPlatform (cognitive 16) · ×1
  • CompletedKubevirtPlatformCreateOptions.NodePoolPlatform (cognitive 16) cmd/nodepool/kubevirt/create.go:277 — CompletedKubevirtPlatformCreateOptions.NodePoolPlatform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · awsprivatelink.diffIDs (cognitive 16) · ×1
  • awsprivatelink.diffIDs (cognitive 16) control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:590 — awsprivatelink.diffIDs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceReconciler.deleteBaseDomainARecords (cognitive 16) · ×1
  • AzurePrivateLinkServiceReconciler.deleteBaseDomainARecords (cognitive 16) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1182 — AzurePrivateLinkServiceReconciler.deleteBaseDomainARecords has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · autoscaler.autoscalerArgs (cognitive 16) · ×1
  • autoscaler.autoscalerArgs (cognitive 16) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/deployment.go:91 — autoscaler.autoscalerArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · kas.generateUsernameClaimMappingWithParity (cognitive 16) · ×1
  • kas.generateUsernameClaimMappingWithParity (cognitive 16) control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth.go:221 — kas.generateUsernameClaimMappingWithParity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oapi.adaptConfig (cognitive 16) · ×1
  • oapi.adaptConfig (cognitive 16) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/config.go:56 — oapi.adaptConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · storage.checkOperandsRolloutStatus (cognitive 16) · ×1
  • storage.checkOperandsRolloutStatus (cognitive 16) control-plane-operator/controllers/hostedcontrolplane/v2/storage/component.go:126 — storage.checkOperandsRolloutStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), match/switch 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.
D2 · Cognitive Complexity · hcpStatusReconciler.reconcile (cognitive 16) · ×1
  • hcpStatusReconciler.reconcile (cognitive 16) control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go:161 — hcpStatusReconciler.reconcile has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingress.NewIngressParams (cognitive 16) · ×1
  • ingress.NewIngressParams (cognitive 16) control-plane-operator/hostedclusterconfigoperator/controllers/resources/ingress/params.go:25 — ingress.NewIngressParams has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · network.applyOVNConfig (cognitive 16) · ×1
  • network.applyOVNConfig (cognitive 16) control-plane-operator/hostedclusterconfigoperator/controllers/resources/network/reconcile.go:111 — network.applyOVNConfig 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.
D2 · Cognitive Complexity · registry.ReconcileRegistryConfig (cognitive 16) · ×1
  • registry.ReconcileRegistryConfig (cognitive 16) control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/registry.go:13 — registry.ReconcileRegistryConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hostedcluster.validateJsonAnnotation (cognitive 16) · ×1
  • hostedcluster.validateJsonAnnotation (cognitive 16) hypershift-operator/controllers/hostedcluster/hostedcluster_webhook.go:309 — hostedcluster.validateJsonAnnotation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.detectAndTriggerEtcdRecovery (cognitive 16) · ×1
  • HostedClusterReconciler.detectAndTriggerEtcdRecovery (cognitive 16) hypershift-operator/controllers/hostedcluster/etcd_recovery.go:142 — HostedClusterReconciler.detectAndTriggerEtcdRecovery has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.etcdRecoveryJobStatus (cognitive 16) · ×1
  • HostedClusterReconciler.etcdRecoveryJobStatus (cognitive 16) hypershift-operator/controllers/hostedcluster/etcd_recovery.go:276 — HostedClusterReconciler.etcdRecoveryJobStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedClusterReconciler.reconcileIngressDefaultCertSync (cognitive 16) · ×1
  • HostedClusterReconciler.reconcileIngressDefaultCertSync (cognitive 16) REDACTED:2299 — HostedClusterReconciler.reconcileIngressDefaultCertSync has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). 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.
D2 · Cognitive Complexity · OpenStack.CAPIProviderDeploymentSpec (cognitive 16) · ×1
  • OpenStack.CAPIProviderDeploymentSpec (cognitive 16) hypershift-operator/controllers/hostedcluster/internal/platform/openstack/openstack.go:186 — OpenStack.CAPIProviderDeploymentSpec 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.
D2 · Cognitive Complexity · hostedclustersizing.SetupWithManager (cognitive 16) · ×1
  • hostedclustersizing.SetupWithManager (cognitive 16) hypershift-operator/controllers/hostedclustersizing/setup.go:41 — hostedclustersizing.SetupWithManager has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 6 belong to 4 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.
D2 · Cognitive Complexity · nodepool.applyAWSPlacementOptions (cognitive 16) · ×1
  • nodepool.applyAWSPlacementOptions (cognitive 16) hypershift-operator/controllers/nodepool/aws.go:241 — nodepool.applyAWSPlacementOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nodepool.defaultAzureNodePoolImage (cognitive 16) · ×1
  • nodepool.defaultAzureNodePoolImage (cognitive 16) hypershift-operator/controllers/nodepool/azure.go:40 — nodepool.defaultAzureNodePoolImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · nodepool.NewConfigGenerator (cognitive 16) · ×1
  • nodepool.NewConfigGenerator (cognitive 16) hypershift-operator/controllers/nodepool/config.go:104 — nodepool.NewConfigGenerator has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CAPI.propagateVersionAndTemplateToMachineSet (cognitive 16) · ×1
  • CAPI.propagateVersionAndTemplateToMachineSet (cognitive 16) hypershift-operator/controllers/nodepool/capi.go:693 — CAPI.propagateVersionAndTemplateToMachineSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CAPI.reconcileMachineSet (cognitive 16) · ×1
  • CAPI.reconcileMachineSet (cognitive 16) hypershift-operator/controllers/nodepool/capi.go:1083 — CAPI.reconcileMachineSet has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2, 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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceController.rejectPrivateEndpointConnections (cognitive 16) · ×1
  • AzurePrivateLinkServiceController.rejectPrivateEndpointConnections (cognitive 16) hypershift-operator/controllers/platform/azure/controller.go:662 — AzurePrivateLinkServiceController.rejectPrivateEndpointConnections has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · AzurePrivateLinkServiceController.findAvailableCIDR (cognitive 16) · ×1
  • AzurePrivateLinkServiceController.findAvailableCIDR (cognitive 16) hypershift-operator/controllers/platform/azure/controller.go:830 — AzurePrivateLinkServiceController.findAvailableCIDR has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 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.
D2 · Cognitive Complexity · main.setupSchedulerControllers (cognitive 16) · ×1
  • main.setupSchedulerControllers (cognitive 16) hypershift-operator/main.go:1079 — main.setupSchedulerControllers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
D2 · Cognitive Complexity · KarpenterIgnitionReconciler.reconcileNodeClassToken (cognitive 16) · ×1
  • KarpenterIgnitionReconciler.reconcileNodeClassToken (cognitive 16) karpenter-operator/controllers/karpenterignition/karpenterignition_controller.go:350 — KarpenterIgnitionReconciler.reconcileNodeClassToken has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · nodeclass.reconcileEC2NodeClass (cognitive 16) · ×1
  • nodeclass.reconcileEC2NodeClass (cognitive 16) karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:302 — nodeclass.reconcileEC2NodeClass has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · EC2NodeClassReconciler.reconcileKarpenterSubnetsConfigMap (cognitive 16) · ×1
  • EC2NodeClassReconciler.reconcileKarpenterSubnetsConfigMap (cognitive 16) karpenter-operator/controllers/nodeclass/ec2_nodeclass_controller.go:496 — EC2NodeClassReconciler.reconcileKarpenterSubnetsConfigMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts) (nesting depth added 5). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kasbootstrap.reconcileFeatureGate (cognitive 16) · ×1
  • kasbootstrap.reconcileFeatureGate (cognitive 16) kas-bootstrap/kas_boostrap.go:145 — kasbootstrap.reconcileFeatureGate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 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.
D2 · Cognitive Complexity · sharedingressconfiggenerator.getBackendsForHostedCluster (cognitive 16) · ×1
  • sharedingressconfiggenerator.getBackendsForHostedCluster (cognitive 16) sharedingress-config-generator/config.go:111 — sharedingressconfiggenerator.getBackendsForHostedCluster has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), match/switch 1 (2 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.
D2 · Cognitive Complexity · azureutil.GetKeyVaultDNSSuffix (cognitive 16) · ×1
  • azureutil.GetKeyVaultDNSSuffix (cognitive 16) support/azureutil/azureutil.go:414 — azureutil.GetKeyVaultDNSSuffix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · gcputil.ReconcileLBResourceLabelAnnotations (cognitive 16) · ×1
  • gcputil.ReconcileLBResourceLabelAnnotations (cognitive 16) support/gcputil/gcputil.go:155 — gcputil.ReconcileLBResourceLabelAnnotations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · Options.Validate (cognitive 16) · ×1
  • Options.Validate (cognitive 16) support/konnectivityproxy/dialer.go:109 — Options.Validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · konnectivityProxy.DialContext (cognitive 16) · ×1
  • konnectivityProxy.DialContext (cognitive 16) support/konnectivityproxy/dialer.go:272 — konnectivityProxy.DialContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderWithOpenShiftImageRegistryOverridesDecorator.Lookup (cognitive 16) · ×1
  • ProviderWithOpenShiftImageRegistryOverridesDecorator.Lookup (cognitive 16) support/releaseinfo/registry_image_content_policies.go:30 — ProviderWithOpenShiftImageRegistryOverridesDecorator.Lookup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 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.
D2 · Cognitive Complexity · upsert.defaultPodSpec (cognitive 16) · ×1
  • upsert.defaultPodSpec (cognitive 16) support/upsert/upsert.go:316 — upsert.defaultPodSpec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 3 (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.
D2 · Cognitive Complexity · main.sourcePath (cognitive 16) · ×1
  • main.sourcePath (cognitive 16) hack/tools/deadcode-report/report.go:114 — main.sourcePath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · hcpstatuspatch.reportUnguardedPatchConstructors (cognitive 16) · ×1
  • hcpstatuspatch.reportUnguardedPatchConstructors (cognitive 16) hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/hcpstatuspatch.go:103 — hcpstatuspatch.reportUnguardedPatchConstructors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sippyannotation.extractDescribeCall (cognitive 16) · ×1
  • sippyannotation.extractDescribeCall (cognitive 16) hack/tools/hypershiftlinter/analyzers/sippyannotation/sippyannotation.go:63 — sippyannotation.extractDescribeCall has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · testfuncstructure.run (cognitive 16) · ×1
  • testfuncstructure.run (cognitive 16) hack/tools/hypershiftlinter/analyzers/testfuncstructure/testfuncstructure.go:79 — testfuncstructure.run has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · main.findReplacementMismatches (cognitive 16) · ×1
  • main.findReplacementMismatches (cognitive 16) hack/tools/verify-api-deps/main.go:196 — main.findReplacementMismatches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · `CreateInfraOptions.Output` takes no context.Context; its 13 sibling operations take one · ×1
  • `CreateInfraOptions.Output` takes no context.Context; its 13 sibling operations take one cmd/infra/aws/create.go:169 — 13 of 14 fallible operations of `CreateInfraOptions` take a `ctx context.Context` (13 of 14). Siblings: CreateInfraOptions.Run (cmd/infra/aws/create.go:154); CreateInfraOptions.CreateInfra (cmd/infra/aws/create.go:193); CreateInfraOptions.CreateVPCS3Endpoint (cmd/infra/aws/ec2.go:126); CreateInfraOptions.CreateDHCPOptions (cmd/infra/aws/ec2.go:166); CreateInfraOptions.CreatePrivateSubnet (cmd/infra/aws/ec2.go:221). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `CreateIAMOptions.Output` takes no context.Context; its 9 sibling operations take one · ×1
  • `CreateIAMOptions.Output` takes no context.Context; its 9 sibling operations take one cmd/infra/aws/create_iam.go:153 — 9 of 10 fallible operations of `CreateIAMOptions` take a `ctx context.Context` (9 of 10). Siblings: CreateIAMOptions.Run (cmd/infra/aws/create_iam.go:139); CreateIAMOptions.CreateIAM (cmd/infra/aws/create_iam.go:177); CreateIAMOptions.CreateOIDCResources (cmd/infra/aws/iam.go:859); CreateIAMOptions.CreateOIDCProvider (cmd/infra/aws/iam.go:981); CreateIAMOptions.CreateOIDCRole (cmd/infra/aws/iam.go:1026). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `util.DefaultGCPMachineType` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use `(T, error)` (an error when absent) · ×1
  • `util.DefaultGCPMachineType` signals absence with a bare `T` (the zero value when absent) where its 4 sibling single-key reads use `(T, error)` (an error when absent) cmd/util/gcp.go:20 — 4 of 5 single-key reads of `package util` return `(T, error)` (an error when absent) (4 of 5). Siblings: util.ReadCredentials (cmd/util/azure.go:50); util.GetConfigWithKubeconfig (cmd/util/client.go:137); util.GetClientWithKubeconfig (cmd/util/client.go:158); util.GetKubernetesClientSetWithKubeconfig (cmd/util/client.go:174). Return `(T, error)` (an error when absent) like its siblings. [rule A5]
D22 · Internal API Consistency · `HostedControlPlaneReconciler.SetupWithManager` takes no context.Context; its 3 sibling operations take one · ×1
  • `HostedControlPlaneReconciler.SetupWithManager` takes no context.Context; its 3 sibling operations take one control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:223 — 3 of 4 fallible operations of `HostedControlPlaneReconciler` take a `ctx context.Context` (3 of 4). Siblings: HostedControlPlaneReconciler.Reconcile (control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:741); HostedControlPlaneReconciler.LookupReleaseImage (control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1307); HostedControlPlaneReconciler.GetGuestClusterClient (control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:3902). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `nodepool.GetRHELStream` takes no context.Context; its 5 sibling operations take one · ×1
  • `nodepool.GetRHELStream` takes no context.Context; its 5 sibling operations take one hypershift-operator/controllers/nodepool/stream.go:22 — 5 of 6 fallible operations of `package nodepool` take a `ctx context.Context` (5 of 6). Siblings: nodepool.NewConfigGenerator (hypershift-operator/controllers/nodepool/config.go:104); nodepool.GetHostedClusterByName (hypershift-operator/controllers/nodepool/nodepool_controller.go:1084); nodepool.BuildMirrorConfigs (hypershift-operator/controllers/nodepool/nto.go:420); nodepool.GetRHELStreamForBootImage (hypershift-operator/controllers/nodepool/osstream.go:92); nodepool.NewToken (hypershift-operator/controllers/nodepool/token.go:100). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `webhookcerts.GenerateInitialWebhookCerts` takes no context.Context; its 3 sibling operations take one · ×1
  • `webhookcerts.GenerateInitialWebhookCerts` takes no context.Context; its 3 sibling operations take one hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:306 — 3 of 4 fallible operations of `package webhookcerts` take a `ctx context.Context` (3 of 4). Siblings: webhookcerts.EnsureWebhookCerts (hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:350); webhookcerts.EnsureLegacyServiceCAMigration (hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:412); webhookcerts.EnsureCRDConversionWebhookCABundles (hypershift-operator/controllers/webhookcerts/webhookcerts_controller.go:547). Take `ctx context.Context` as the first parameter, like its siblings, and pass it on. [rule A1]
D22 · Internal API Consistency · `Subnets.ToMap` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) · ×1
  • `Subnets.ToMap` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) pkg/capi/aws/api/v1beta2/network_types.go:749 — 3 of 4 collection-returning members of `Subnets` return a slice (`[]T`) (3 of 4). Siblings: Subnets.IDs (pkg/capi/aws/api/v1beta2/network_types.go:759); Subnets.IDsWithEdge (pkg/capi/aws/api/v1beta2/network_types.go:775); Subnets.GetUniqueZones (pkg/capi/aws/api/v1beta2/network_types.go:863). Return a slice (`[]T`). [rule A4]
D22 · Internal API Consistency · `etcdcli.IsClusterHealthy` types `memberHealth` as `memberHealth` where 4 sibling members type it `[]healthCheck` · ×1
  • `etcdcli.IsClusterHealthy` types `memberHealth` as `memberHealth` where 4 sibling members type it `[]healthCheck` pkg/etcdcli/health.go:256 — 4 of 5 members of `package etcdcli` that take `memberHealth` type it `[]healthCheck` (4 of 5). Siblings: etcdcli.GetUnhealthyMemberNames (pkg/etcdcli/health.go:198); etcdcli.GetHealthyMemberNames (pkg/etcdcli/health.go:209); etcdcli.GetUnstartedMemberNames (pkg/etcdcli/health.go:220); etcdcli.IsQuorumFaultTolerant (pkg/etcdcli/health.go:237). Type `memberHealth` as `[]healthCheck`. [rule A8]
D22 · Internal API Consistency · `awsutil.EC2TagsToMap` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) · ×1
  • `awsutil.EC2TagsToMap` returns a map (`map[K]V`) where its 3 siblings return a slice (`[]T`) support/awsutil/sg.go:278 — 3 of 4 collection-returning members of `package awsutil` return a slice (`[]T`) (3 of 4). Siblings: awsutil.DefaultWorkerSGIngressRules (support/awsutil/sg.go:23); awsutil.VPCEndpointSecurityGroupRules (support/awsutil/sg.go:181); awsutil.MapToEC2Tags (support/awsutil/sg.go:264). Return a slice (`[]T`). [rule A4]
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: hostedcontrolplane_controller.go → providerconfig.go, providerconfig.go, reconcile.go, deployment.go control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go — `control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go` changes together with 4 other files — `control-plane-operator/controllers/hostedcontrolplane/cloud/azure/providerconfig.go`, `control-plane-operator/controllers/hostedcontrolplane/cloud/openstack/providerconfig.go`, `control-plane-operator/controllers/hostedcontrolplane/cvo/reconcile.go`, `control-plane-operator/controllers/hostedcontrolplane/oauth/deployment.go` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D35 · Change Coupling · Change coupling · ×1
  • Change coupling: deployment.go ↔ params.go control-plane-operator/controllers/hostedcontrolplane/oauth/deployment.go:1 — `control-plane-operator/controllers/hostedcontrolplane/oauth/deployment.go` and `control-plane-operator/controllers/hostedcontrolplane/oauth/params.go` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 7 shared commits counted here, the most recent 3 are `03cc4b66` Remove unused oauth code; `da86b6b9` Add HTTP konnectivity proxy to OAuth server; `612fc127` enable audit log for oauth-openshift — run `git show` on any of them.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 37 shared lines) · ×1
  • Near-duplicate member family (3 members, 37 shared lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2280 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2280-2341 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2343-2413 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2415-2480 — These 3 members are variants of one another: a block of 37 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (881 shared lines) · ×1
  • Near-duplicate member pair (881 shared lines) REDACTED:462 — REDACTED:462-1726 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:56-1844 — These two members are variants of one another: 881 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 · Near-duplicate member pair (197 shared lines) · ×1
  • Near-duplicate member pair (197 shared lines) pkg/capi/openstack/api/v1beta1/types.go:267 — pkg/capi/openstack/api/v1beta1/types.go:267-618 | pkg/capi/openstack/api/v1beta2/types.go:340-725 — These two members are variants of one another: 197 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 · Near-duplicate member pair (50 shared lines) · ×1
  • Near-duplicate member pair (50 shared lines) cmd/oadp/backup.go:87 — cmd/oadp/backup.go:87-207 | cmd/oadp/schedule.go:113-233 — 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.
D4 · Code Duplication · Near-duplicate member pair (37 shared lines) · ×1
  • Near-duplicate member pair (37 shared lines) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1084 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1084-1134 | hypershift-operator/controllers/platform/gcp/privateserviceconnect_controller.go:526-571 — These two members are variants of one another: 37 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • Near-duplicate member pair (30 shared lines) hypershift-operator/main.go:1219 — hypershift-operator/main.go:1219-1283 | hypershift-operator/main.go:1287-1351 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) cmd/nodepool/aws/create.go:99 — cmd/nodepool/aws/create.go:99-125 | cmd/nodepool/azure/create.go:193-217 | cmd/nodepool/gcp/create.go:107-133 | cmd/nodepool/kubevirt/create.go:242-266 | cmd/nodepool/openstack/create.go:103-128 | product-cli/cmd/nodepool/aws/create.go:11-44 | product-cli/cmd/nodepool/azure/create.go:11-36 | product-cli/cmd/nodepool/kubevirt/create.go:11-35 | product-cli/cmd/nodepool/openstack/create.go:11-35 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) hypershift-operator/controllers/hostedcluster/network_policies.go:458 — hypershift-operator/controllers/hostedcluster/network_policies.go:458-479 | hypershift-operator/controllers/hostedcluster/network_policies.go:481-502 | hypershift-operator/controllers/hostedcluster/network_policies.go:504-525 | hypershift-operator/controllers/hostedcluster/network_policies.go:527-548 | hypershift-operator/controllers/hostedcluster/network_policies.go:550-571 | hypershift-operator/controllers/hostedcluster/network_policies.go:573-594 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Edited copy of a member (80 corresponding lines) · ×1
  • Edited copy of a member (80 corresponding lines) hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:44 — hypershift-operator/controllers/auditlogpersistence/configmap_webhook.go:44-123 | hypershift-operator/controllers/auditlogpersistence/pod_webhook.go:50-132 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) REDACTED:403 — REDACTED:403-465 | REDACTED:473-535 — 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) cmd/infra/powervs/create.go:188 — cmd/infra/powervs/create.go:188-241 | cmd/infra/powervs/destroy.go:79-131 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) REDACTED:280 — REDACTED:280-337 | REDACTED:363-437 — 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 (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1973 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1973-2050 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2136-2211 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (62 corresponding lines) · ×1
  • Edited copy of a member (62 corresponding lines) hypershift-operator/controllers/nodepool/conditions.go:451 — hypershift-operator/controllers/nodepool/conditions.go:451-512 | hypershift-operator/controllers/nodepool/conditions.go:550-615 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 61+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 61+ corresponding lines) cmd/oadp/backup.go:25 — cmd/oadp/backup.go:25-85 | cmd/oadp/restore.go:23-98 | cmd/oadp/schedule.go:21-105 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 61 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) cmd/infra/powervs/destroy.go:471 — cmd/infra/powervs/destroy.go:471-515 | cmd/infra/powervs/destroy.go:525-567 — 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 (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:103 — control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:103-170 | control-plane-operator/controllers/hostedcontrolplane/v2/storage/component.go:126-197 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (155 corresponding lines) · ×1
  • Edited copy of a member (155 corresponding lines) pkg/capi/aws/api/v1beta1/conditions_consts.go:21 — pkg/capi/aws/api/v1beta1/conditions_consts.go:21-175 | pkg/capi/aws/api/v1beta2/conditions_consts.go:21-201 — These two members are one piece of code written twice and then edited apart: 155 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:89 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:89-143 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:127-173 — 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 (251 corresponding lines) · ×1
  • Edited copy of a member (251 corresponding lines) pkg/capi/openstack/api/v1beta1/openstackmachine_types.go:29 — pkg/capi/openstack/api/v1beta1/openstackmachine_types.go:29-294 | pkg/capi/openstack/api/v1beta2/openstackmachine_types.go:26-276 — These two members are one piece of code written twice and then edited apart: 251 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 20+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 20+ corresponding lines) REDACTED:140 — REDACTED:140-159 | REDACTED:229-250 | REDACTED:174-199 | REDACTED:291-318 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/certs.go:28 — control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/certs.go:28-69 | control-plane-operator/controllers/hostedcontrolplane/v2/external_oidc_webhook/certs.go:30-71 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 32+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 32+ corresponding lines) hypershift-operator/controllers/ignitionpayload/config.go:94 — hypershift-operator/controllers/ignitionpayload/config.go:94-125 | hypershift-operator/controllers/nodepool/config.go:389-425 | hypershift-operator/controllers/nodepool/nto.go:420-456 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (140 corresponding lines) · ×1
  • Edited copy of a member (140 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:628 — pkg/capi/openstack/api/v1beta1/types.go:628-767 | pkg/capi/openstack/api/v1beta2/types.go:735-925 — These two members are one piece of code written twice and then edited apart: 140 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/external_oidc_webhook/component.go:37 — control-plane-operator/controllers/hostedcontrolplane/v2/external_oidc_webhook/component.go:37-74 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth/component.go:38-84 — 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 (277 corresponding lines) · ×1
  • Edited copy of a member (277 corresponding lines) control-plane-operator/controllers/hostedcontrolplane/kas/auth_types.go:13 — control-plane-operator/controllers/hostedcontrolplane/kas/auth_types.go:13-289 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth_types.go:19-306 — These two members are one piece of code written twice and then edited apart: 277 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 19+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 19+ corresponding lines) REDACTED:161 — REDACTED:161-180 | REDACTED:182-200 | REDACTED:201-226 | REDACTED:228-252 — 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, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) product-cli/cmd/iam/azure/create.go:26 — product-cli/cmd/iam/azure/create.go:26-57 | product-cli/cmd/iam/azure/destroy.go:26-56 | product-cli/cmd/infra/azure/create.go:26-54 | product-cli/cmd/infra/azure/destroy.go:26-54 — These 4 members are one piece of code written 4 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 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) cmd/cluster/gcp/create.go:265 — cmd/cluster/gcp/create.go:265-292 | product-cli/cmd/cluster/kubevirt/create.go:12-38 | product-cli/REDACTED:12-38 — 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 copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) control-plane-operator/controllers/azureprivatelinkservice/controller.go:1102 — control-plane-operator/controllers/azureprivatelinkservice/controller.go:1102-1125 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:1127-1150 | control-plane-operator/controllers/azureprivatelinkservice/controller.go:1228-1252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 29+ corresponding lines) cmd/cluster/agent/create.go:153 — cmd/cluster/agent/create.go:153-182 | cmd/cluster/azure/create.go:44-72 | cmd/cluster/kubevirt/create.go:327-355 | cmd/cluster/none/create.go:102-130 | REDACTED:272-300 | product-cli/cmd/cluster/agent/create.go:12-41 | product-cli/cmd/cluster/azure/create.go:13-42 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:21 — control-plane-operator/controllers/hostedcontrolplane/v2/clusterpolicy/config.go:21-46 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go:58-77 | control-plane-operator/controllers/hostedcontrolplane/v2/routecm/config.go:21-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 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) control-plane-operator/hostedclusterconfigoperator/controllers/drainer/setup.go:18 — control-plane-operator/hostedclusterconfigoperator/controllers/drainer/setup.go:18-39 | control-plane-operator/hostedclusterconfigoperator/controllers/node/setup.go:17-33 | control-plane-operator/hostedclusterconfigoperator/controllers/spotremediation/setup.go:20-42 — 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 copy of a member (167 corresponding lines) · ×1
  • Edited copy of a member (167 corresponding lines) pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go:28 — pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go:28-194 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go:30-268 — These two members are one piece of code written twice and then edited apart: 167 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (90 corresponding lines) · ×1
  • Edited copy of a member (90 corresponding lines) pkg/capi/openstack/api/v1beta1/conditions_consts.go:21 — pkg/capi/openstack/api/v1beta1/conditions_consts.go:21-110 | pkg/capi/openstack/api/v1beta2/conditions_consts.go:19-110 — These two members are one piece of code written twice and then edited apart: 90 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 22+ corresponding lines) cmd/cluster/agent/destroy.go:22 — cmd/cluster/agent/destroy.go:22-45 | cmd/cluster/gcp/destroy.go:15-37 | cmd/cluster/kubevirt/destroy.go:11-33 | cmd/cluster/none/destroy.go:18-40 | product-cli/cmd/cluster/agent/destroy.go:11-33 | product-cli/cmd/cluster/kubevirt/destroy.go:11-32 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 19+ corresponding lines) cmd/bastion/aws/destroy.go:156 — cmd/bastion/aws/destroy.go:156-174 | cmd/bastion/aws/destroy.go:176-194 | cmd/bastion/aws/destroy.go:196-214 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) hypershift-operator/controllers/nodepool/capi.go:329 — hypershift-operator/controllers/nodepool/capi.go:329-351 | hypershift-operator/controllers/nodepool/capi.go:371-393 | hypershift-operator/controllers/nodepool/capi.go:429-451 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (78 corresponding lines) · ×1
  • Edited copy of a member (78 corresponding lines) pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go:28 — pkg/capi/aws/api/v1beta2/awsmachinetemplate_types.go:28-119 | pkg/capi/azure/api/v1beta1/azuremachinetemplate_types.go:27-104 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/alerts/reconcile.go:40 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/alerts/reconcile.go:40-48 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/crd/reconcile.go:31-39 | support/assets/readasset.go:28-37 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 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 (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) pkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.go:27 — pkg/capi/ibmcloud/api/v1beta1/ibmpowervsimage_types.go:27-100 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsimage_types.go:27-128 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 12+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 12+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:72 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:72-84 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:86-99 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:101-114 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:170-183 | control-plane-operator/controllers/hostedcontrolplane/v2/kcm/kubeconfig.go:14-25 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 22+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 22+ corresponding lines) support/metrics/sets.go:116 — support/metrics/sets.go:116-137 | support/metrics/sets.go:354-375 | support/metrics/sets.go:377-398 | support/metrics/sets.go:400-421 | support/metrics/sets.go:423-444 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 18+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/olm/catalog_operator/component.go:34 — control-plane-operator/controllers/hostedcontrolplane/v2/olm/catalog_operator/component.go:34-56 | control-plane-operator/controllers/hostedcontrolplane/v2/olm/olm_operator/component.go:34-60 | control-plane-operator/controllers/hostedcontrolplane/v2/olm/packageserver/component.go:33-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 16+ corresponding lines) cmd/install/assets/hypershift_operator.go:136 — cmd/install/assets/hypershift_operator.go:136-151 | cmd/install/assets/hypershift_operator.go:159-174 | cmd/install/assets/hypershift_operator.go:182-197 | cmd/install/assets/hypershift_operator.go:206-221 | cmd/install/assets/hypershift_operator.go:228-243 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) hypershift-operator/controllers/etcdbackup/reconciler.go:438 — hypershift-operator/controllers/etcdbackup/reconciler.go:438-447 | hypershift-operator/controllers/etcdbackup/reconciler.go:514-529 | hypershift-operator/controllers/ignitionpayload/controller.go:472-481 | support/karpenter/karpenter.go:120-129 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:405 — control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:405-414 | control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:416-425 | control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:427-437 — 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 (4 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 13+ corresponding lines) cmd/util/client.go:68 — cmd/util/client.go:68-80 | cmd/util/client.go:84-96 | cmd/util/client.go:100-112 | cmd/util/client.go:116-128 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (81 corresponding lines) · ×1
  • Edited copy of a member (81 corresponding lines) pkg/capi/openstack/api/v1beta1/types.go:840 — pkg/capi/openstack/api/v1beta1/types.go:840-920 | pkg/capi/openstack/api/v1beta2/types.go:999-1079 — These two members are one piece of code written twice and then edited apart: 81 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 15+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 15+ corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:296 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:296-310 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:312-326 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:366-380 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:486-500 — 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 (5 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 13+ corresponding lines) cmd/cluster/aws/create.go:452 — cmd/cluster/aws/create.go:452-464 | cmd/cluster/azure/manifests.go:10-22 | cmd/cluster/gcp/create.go:294-306 | cmd/cluster/kubevirt/create.go:301-314 | REDACTED:255-268 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/certs.go:16 — control-plane-operator/controllers/hostedcontrolplane/v2/endpoint_resolver/certs.go:16-26 | control-plane-operator/controllers/hostedcontrolplane/v2/external_oidc_webhook/certs.go:18-28 | control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/pki.go:24-34 | control-plane-operator/controllers/hostedcontrolplane/v2/metrics_proxy/certs.go:19-29 — These 4 members are one piece of code written 4 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 4 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) pkg/capi/openstack/api/v1beta1/types.go:932 — pkg/capi/openstack/api/v1beta1/types.go:932-968 | pkg/capi/openstack/api/v1beta2/types.go:1091-1132 — 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 copies of one member (3 members, 7+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 7+ corresponding lines) control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:133 — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:133-139 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:124-130 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.go:112-118 — 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 (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) control-plane-operator/hostedclusterconfigoperator/controllers/resources/namespaces/reconcile.go:31 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/namespaces/reconcile.go:31-40 | support/labelenforcingclient/labelenforcer.go:42-51 | support/netutil/route.go:178-185 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (382 lines × 2) · ×1
  • Duplicated block (382 lines × 2) REDACTED:913 — REDACTED:913-1294 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:517-898 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:913` 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.
D4 · Code Duplication · Duplicated block (156–159 lines × 2) · ×1
  • Duplicated block (156–159 lines × 2) pkg/capi/aws/api/v1beta1/awsidentity_types.go:24 — pkg/capi/aws/api/v1beta1/awsidentity_types.go:24-179 | pkg/capi/aws/api/v1beta2/awsidentity_types.go:24-182 — `pkg/capi/aws/api/v1beta1/awsidentity_types.go` and `pkg/capi/aws/api/v1beta2/awsidentity_types.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 2 separate duplicated blocks between them, totalling at least 169 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (169 lines × 2) · ×1
  • Duplicated block (169 lines × 2) REDACTED:584 — REDACTED:584-752 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:157-325 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:584` 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.
D4 · Code Duplication · Duplicated block (101 lines × 2) · ×1
  • Duplicated block (101 lines × 2) REDACTED:643 — REDACTED:643-743 | REDACTED:713-813 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (53–101 lines × 2) · ×1
  • Duplicated block (53–101 lines × 2) pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go:73 — pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go:73-173 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachine_types.go:124-176 — 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 `pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachine_types.go:73` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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.
D4 · Code Duplication · Duplicated block (196 lines × 2) · ×1
  • Duplicated block (196 lines × 2) control-plane-operator/controllers/hostedcontrolplane/kas/auth_types.go:94 — control-plane-operator/controllers/hostedcontrolplane/kas/auth_types.go:94-289 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth_types.go:111-306 — before extracting anything, compare `control-plane-operator/controllers/hostedcontrolplane/kas/auth_types.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/kas/auth_types.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. 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.
D4 · Code Duplication · Duplicated block (96 lines × 2) · ×1
  • Duplicated block (96 lines × 2) pkg/capi/aws/api/v1beta1/types.go:77 — pkg/capi/aws/api/v1beta1/types.go:77-172 | pkg/capi/aws/api/v1beta2/types.go:103-198 — `pkg/capi/aws/api/v1beta1/types.go` and `pkg/capi/aws/api/v1beta2/types.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 2 separate duplicated blocks between them, totalling at least 177 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/aws/api/v1beta1/types.go:77` 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.
D4 · Code Duplication · Duplicated block (128 lines × 2) · ×1
  • Duplicated block (128 lines × 2) REDACTED:769 — REDACTED:769-896 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:382-509 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:769` 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.
D4 · Code Duplication · Duplicated block (89 lines × 2) · ×1
  • Duplicated block (89 lines × 2) pkg/capi/agent/v1alpha1/agentmachine_types.go:25 — pkg/capi/agent/v1alpha1/agentmachine_types.go:25-113 | pkg/capi/agent/v1beta1/agentmachine_types.go:25-113 — `pkg/capi/agent/v1alpha1/agentmachine_types.go` and `pkg/capi/agent/v1beta1/agentmachine_types.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 89 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (83–84 lines × 2) · ×1
  • Duplicated block (83–84 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:293 — pkg/capi/openstack/api/v1beta1/types.go:293-375 | pkg/capi/openstack/api/v1beta2/types.go:373-456 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/openstack/api/v1beta1/types.go:293` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (81 lines × 2) · ×1
  • Duplicated block (81 lines × 2) pkg/capi/aws/api/v1beta1/types.go:213 — pkg/capi/aws/api/v1beta1/types.go:213-293 | pkg/capi/aws/api/v1beta2/types.go:497-577 — `pkg/capi/aws/api/v1beta1/types.go` and `pkg/capi/aws/api/v1beta2/types.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 2 separate duplicated blocks between them, totalling at least 177 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/aws/api/v1beta1/types.go:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (77 lines × 2) · ×1
  • Duplicated block (77 lines × 2) REDACTED:545 — REDACTED:545-621 | REDACTED:615-691 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (76 lines × 2) · ×1
  • Duplicated block (76 lines × 2) pkg/capi/agent/v1alpha1/agentcluster_types.go:24 — pkg/capi/agent/v1alpha1/agentcluster_types.go:24-99 | pkg/capi/agent/v1beta1/agentcluster_types.go:24-99 — `pkg/capi/agent/v1alpha1/agentcluster_types.go` and `pkg/capi/agent/v1beta1/agentcluster_types.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 76 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (62–71 lines × 2) · ×1
  • Duplicated block (62–71 lines × 2) pkg/capi/openstack/api/v1beta1/openstackmachine_types.go:115 — pkg/capi/openstack/api/v1beta1/openstackmachine_types.go:115-176 | pkg/capi/openstack/api/v1beta2/openstackmachine_types.go:111-181 — 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 `pkg/capi/openstack/api/v1beta1/openstackmachine_types.go:115` 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.
D4 · Code Duplication · Duplicated block (68 lines × 2) · ×1
  • Duplicated block (68 lines × 2) pkg/capi/aws/api/v1beta1/awscluster_types.go:72 — pkg/capi/aws/api/v1beta1/awscluster_types.go:72-139 | pkg/capi/aws/api/v1beta2/awscluster_types.go:84-151 — `pkg/capi/aws/api/v1beta1/awscluster_types.go` and `pkg/capi/aws/api/v1beta2/awscluster_types.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 68 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/api/v1beta1/awscluster_types.go:72` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (66 lines × 2) · ×1
  • Duplicated block (66 lines × 2) REDACTED:470 — REDACTED:470-535 | REDACTED:540-605 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (62–63 lines × 2) · ×1
  • Duplicated block (62–63 lines × 2) pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go:149 — pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go:149-211 | pkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.go:241-302 — `pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go` and `pkg/capi/aws/exp/api/v1beta2/awsmachinepool_types.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 63 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/exp/api/v1beta1/awsmachinepool_types.go:149` 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.
D4 · Code Duplication · Duplicated block (60–61 lines × 2) · ×1
  • Duplicated block (60–61 lines × 2) pkg/capi/aws/api/v1beta1/network_types.go:372 — pkg/capi/aws/api/v1beta1/network_types.go:372-431 | pkg/capi/aws/api/v1beta2/network_types.go:889-949 — 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.
D4 · Code Duplication · Duplicated block (58–59 lines × 2) · ×1
  • Duplicated block (58–59 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:774 — pkg/capi/openstack/api/v1beta1/types.go:774-831 | pkg/capi/openstack/api/v1beta2/types.go:932-990 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • Duplicated block (53 lines × 2) hypershift-operator/controllers/ignitionpayload/config.go:133 — hypershift-operator/controllers/ignitionpayload/config.go:133-185 | hypershift-operator/controllers/nodepool/config.go:433-485 — `hypershift-operator/controllers/ignitionpayload/config.go` and `hypershift-operator/controllers/nodepool/config.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 90 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/ignitionpayload/config.go:133` 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.
D4 · Code Duplication · Duplicated block (45–49 lines × 2) · ×1
  • Duplicated block (45–49 lines × 2) REDACTED:2038 — REDACTED:2038-2082 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1085-1133 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:2038` 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.
D4 · Code Duplication · Duplicated block (48 lines × 2) · ×1
  • Duplicated block (48 lines × 2) pkg/capi/aws/exp/api/v1beta1/conditions_consts.go:57 — pkg/capi/aws/exp/api/v1beta1/conditions_consts.go:57-104 | pkg/capi/aws/exp/api/v1beta2/conditions_consts.go:75-122 — `pkg/capi/aws/exp/api/v1beta1/conditions_consts.go` and `pkg/capi/aws/exp/api/v1beta2/conditions_consts.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 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/exp/api/v1beta1/conditions_consts.go:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) REDACTED:404 — REDACTED:404-450 | REDACTED:474-520 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:404` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (46 lines × 3) · ×1
  • Duplicated block (46 lines × 3) hypershift-operator/controllers/hostedcluster/network_policies.go:406 — hypershift-operator/controllers/hostedcluster/network_policies.go:406-451 | hypershift-operator/controllers/hostedcluster/network_policies.go:917-962 | hypershift-operator/controllers/sharedingress/router.go:337-382 — 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.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) pkg/capi/aws/api/v1beta1/tags.go:79 — pkg/capi/aws/api/v1beta1/tags.go:79-123 | pkg/capi/aws/api/v1beta2/tags.go:79-123 — `pkg/capi/aws/api/v1beta1/tags.go` and `pkg/capi/aws/api/v1beta2/tags.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 2 separate duplicated blocks between them, totalling at least 57 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/capi/aws/api/v1beta1/tags.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. 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.
D4 · Code Duplication · Duplicated block (41–44 lines × 2) · ×1
  • Duplicated block (41–44 lines × 2) REDACTED:464 — REDACTED:464-507 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:57-97 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • Duplicated block (40 lines × 2) pkg/capi/aws/exp/api/v1beta1/types.go:154 — pkg/capi/aws/exp/api/v1beta1/types.go:154-193 | pkg/capi/aws/exp/api/v1beta2/types.go:205-244 — `pkg/capi/aws/exp/api/v1beta1/types.go` and `pkg/capi/aws/exp/api/v1beta2/types.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 124 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/aws/exp/api/v1beta1/types.go:154` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go:27 — pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go:27-64 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.go:27-65 — `pkg/capi/ibmcloud/api/v1beta1/ibmpowervsmachinetemplate_types.go` and `pkg/capi/ibmcloud/api/v1beta2/ibmpowervsmachinetemplate_types.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 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (36–38 lines × 2) · ×1
  • Duplicated block (36–38 lines × 2) REDACTED:291 — REDACTED:291-326 | REDACTED:380-417 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:291` 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.
D4 · Code Duplication · Duplicated block (49 lines × 2) · ×1
  • Duplicated block (49 lines × 2) REDACTED:1371 — REDACTED:1371-1419 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:963-1011 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1371` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1013` calls `reconcileCLISecrets`, `Errorf` and `REDACTED:1422` 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) REDACTED:1984 — REDACTED:1984-2015 | hypershift-operator/controllers/hostedcluster/reconcile_legacy.go:1175-1206 — before extracting anything, compare `REDACTED` and `hypershift-operator/controllers/hostedcluster/reconcile_legacy.go` as WHOLE FILES: this scan already matched 27 separate duplicated blocks between them, totalling at least 1104 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 `REDACTED:1984` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:163 — hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.go:163-190 | hypershift-operator/controllers/hostedcluster/internal/platform/powervs/powervs.go:172-200 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/hostedcluster/internal/platform/kubevirt/kubevirt.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. 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.
D4 · Code Duplication · Duplicated block (24–28 lines × 2) · ×1
  • Duplicated block (24–28 lines × 2) hypershift-operator/controllers/nodepool/capi.go:491 — hypershift-operator/controllers/nodepool/capi.go:491-514 | hypershift-operator/controllers/nodepool/capi.go:1138-1165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:491` 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, `hypershift-operator/controllers/nodepool/capi.go:490` calls `Version` and `hypershift-operator/controllers/nodepool/capi.go:1137` 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.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:220 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go:220-245 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/admissionpolicies.go:76-101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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.
D4 · Code Duplication · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) hypershift-operator/controllers/nodepool/capi.go:662 — hypershift-operator/controllers/nodepool/capi.go:662-686 | hypershift-operator/controllers/nodepool/capi.go:737-758 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/capi.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 `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.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) hypershift-operator/controllers/nodepool/capi.go:812 — hypershift-operator/controllers/nodepool/capi.go:812-835 | hypershift-operator/controllers/nodepool/capi.go:1257-1279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/capi.go:812` 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) REDACTED:372 — REDACTED:372-394 | REDACTED:150-172 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (15–23 lines × 2) · ×1
  • Duplicated block (15–23 lines × 2) hypershift-operator/controllers/nodepool/conditions.go:730 — hypershift-operator/controllers/nodepool/conditions.go:730-744 | hypershift-operator/controllers/nodepool/conditions.go:784-806 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/conditions.go:730` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) hypershift-operator/controllers/sharedingress/sharedingress_controller.go:115 — hypershift-operator/controllers/sharedingress/sharedingress_controller.go:115-135 | sharedingress-config-generator/controller.go:60-80 — 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.
D4 · Code Duplication · Duplicated block (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1226 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1226-1245 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2926-2940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16–20 lines × 2) · ×1
  • Duplicated block (16–20 lines × 2) hypershift-operator/controllers/nodepool/capi.go:635 — hypershift-operator/controllers/nodepool/capi.go:635-654 | hypershift-operator/controllers/nodepool/capi.go:700-715 — both copies are in the same file, so extract the 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 `hypershift-operator/controllers/nodepool/capi.go:635` 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) cmd/cluster/agent/destroy.go:27 — cmd/cluster/agent/destroy.go:27-45 | cmd/cluster/gcp/destroy.go:20-37 | cmd/cluster/none/destroy.go:23-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/agent/destroy.go:27` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) cmd/infra/aws/create.go:171 — cmd/infra/aws/create.go:171-189 | cmd/infra/aws/create_iam.go:155-173 | cmd/infra/gcp/create_infra.go:108-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:45 — hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:45-63 | hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:82-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hack/tools/hypershiftlinter/analyzers/testcasename/testcasename.go:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) cmd/cluster/azure/destroy.go:57 — cmd/cluster/azure/destroy.go:57-74 | cmd/cluster/openstack/destroy.go:30-47 | cmd/cluster/powervs/destroy.go:55-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/azure/destroy.go:57` 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.
D4 · Code Duplication · Duplicated block (12–18 lines × 2) · ×1
  • Duplicated block (12–18 lines × 2) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2445 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2445-2456 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2647-2664 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2325 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2325-2341 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2397-2413 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2464-2480 — all 3 copies are in the same file, so extract the block into one function there and call 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 `control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:2325` 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.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) hypershift-operator/controllers/ignitionpayload/config.go:110 — hypershift-operator/controllers/ignitionpayload/config.go:110-125 | hypershift-operator/controllers/nodepool/config.go:409-425 — `hypershift-operator/controllers/ignitionpayload/config.go` and `hypershift-operator/controllers/nodepool/config.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 90 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/ignitionpayload/config.go:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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.
D4 · Code Duplication · Duplicated block (16 lines × 11) · ×1
  • Duplicated block (16 lines × 11) cmd/cluster/agent/create.go:167 — cmd/cluster/agent/create.go:167-182 | cmd/cluster/aws/create.go:570-585 | cmd/cluster/azure/create.go:57-72 | cmd/cluster/gcp/create.go:277-292 | cmd/cluster/kubevirt/create.go:340-355 | cmd/cluster/none/create.go:115-130 | REDACTED:285-300 | product-cli/cmd/cluster/agent/create.go:26-41 | product-cli/cmd/cluster/aws/create.go:49-64 | product-cli/cmd/cluster/kubevirt/create.go:23-38 | product-cli/REDACTED:23-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 11 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 11 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/agent/create.go:167` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/cluster/agent/create.go:163` calls `MarkFlagRequired` and `cmd/cluster/azure/create.go:53` 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 9) · ×1
  • Duplicated block (15–16 lines × 9) cmd/nodepool/aws/create.go:110 — cmd/nodepool/aws/create.go:110-125 | cmd/nodepool/azure/create.go:202-217 | cmd/nodepool/gcp/create.go:118-133 | cmd/nodepool/kubevirt/create.go:251-266 | cmd/nodepool/openstack/create.go:113-128 | product-cli/cmd/nodepool/aws/create.go:29-44 | product-cli/cmd/nodepool/azure/create.go:22-36 | product-cli/cmd/nodepool/kubevirt/create.go:20-35 | product-cli/cmd/nodepool/openstack/create.go:20-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 9 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 9 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/nodepool/aws/create.go:110` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/nodepool/openstack/create.go:131` calls `Type` and `cmd/nodepool/kubevirt/create.go:269` 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:225 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:225-240 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/azure.go:271-286 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/ibmcloud.go:260-275 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms/aws.go:225` 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.
D4 · Code Duplication · Duplicated block (13–16 lines × 2) · ×1
  • Duplicated block (13–16 lines × 2) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1156 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1156-1171 | control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/client.go:102-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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.
D4 · Code Duplication · Duplicated block (15 lines × 6) · ×1
  • Duplicated block (15 lines × 6) hypershift-operator/controllers/hostedcluster/network_policies.go:459 — hypershift-operator/controllers/hostedcluster/network_policies.go:459-473 | hypershift-operator/controllers/hostedcluster/network_policies.go:482-496 | hypershift-operator/controllers/hostedcluster/network_policies.go:505-519 | hypershift-operator/controllers/hostedcluster/network_policies.go:528-542 | hypershift-operator/controllers/hostedcluster/network_policies.go:551-565 | hypershift-operator/controllers/hostedcluster/network_policies.go:574-588 — 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 `hypershift-operator/controllers/hostedcluster/network_policies.go:459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–14 lines × 3) · ×1
  • Duplicated block (9–14 lines × 3) control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1150 — control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1150-1163 | control-plane-operator/controllers/healthcheck/gcp.go:140-148 | control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/client.go:98-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.go:1150` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:200 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:200-212 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:221-233 | control-plane-operator/controllers/hostedcontrolplane/v2/kas/kubeconfig.go:244-256 | support/controlplane-component/kubeconfig.go:22-34 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:324 — control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.go:324-335 | control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go:135-147 | support/globalconfig/namedcerts.go:24-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/v2/kas/deployment.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.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) etcd-defrag/main.go:43 — etcd-defrag/main.go:43-52 | REDACTED:129-140 | kas-bootstrap/main.go:32-41 — `etcd-defrag/main.go` and `kas-bootstrap/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `etcd-defrag/main.go:43` it does not close everything it opens, so those 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, `etcd-defrag/main.go:53` calls `Exit` and `REDACTED:141` 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) pkg/etcdcli/etcdcli.go:237 — pkg/etcdcli/etcdcli.go:237-247 | pkg/etcdcli/etcdcli.go:302-312 | pkg/etcdcli/etcdcli.go:342-352 | pkg/etcdcli/etcdcli.go:373-383 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/etcdcli/etcdcli.go:237` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) cmd/cluster/azure/destroy.go:55 — cmd/cluster/azure/destroy.go:55-64 | cmd/cluster/openstack/destroy.go:28-37 | cmd/cluster/powervs/destroy.go:53-62 | product-cli/cmd/cluster/openstack/destroy.go:22-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/azure/destroy.go:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×1
  • Duplicated block (9–10 lines × 3) cmd/cluster/aws/create.go:366 — cmd/cluster/aws/create.go:366-374 | cmd/cluster/azure/create.go:515-523 | cmd/cluster/gcp/create.go:355-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/aws/create.go:366` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (4–10 lines × 4) · ×1
  • Duplicated block (4–10 lines × 4) control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:710 — control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:710-713 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:190-199 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:218-221 | control-plane-operator/controllers/hostedcontrolplane/kas/service.go:438-447 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/infra/infra.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. 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) hypershift-operator/controllers/etcdbackup/reconciler.go:294 — hypershift-operator/controllers/etcdbackup/reconciler.go:294-300 | hypershift-operator/controllers/etcdbackup/reconciler.go:573-581 | hypershift-operator/controllers/etcdbackup/reconciler.go:605-613 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/etcdbackup/reconciler.go:294` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) cmd/cluster/core/destroy.go:286 — cmd/cluster/core/destroy.go:286-293 | cmd/cluster/core/destroy.go:311-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) cmd/cluster/powervs/create.go:262 — cmd/cluster/powervs/create.go:262-269 | etcd-defrag/main.go:42-49 | REDACTED:128-135 | kas-bootstrap/main.go:31-38 | sync-fg-configmap/update.go:47-54 — `etcd-defrag/main.go` and `kas-bootstrap/main.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/cluster/powervs/create.go:262` it does not close everything it opens, so those 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, `etcd-defrag/main.go:53` calls `Exit` and `REDACTED:141` 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) REDACTED:194 — REDACTED:194-200 | REDACTED:245-252 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 538 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:194` 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.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) REDACTED:562 — REDACTED:562-567 | REDACTED:809-813 | REDACTED:932-937 | REDACTED:971-977 | REDACTED:1013-1017 | REDACTED:1126-1131 — 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 `REDACTED:562` it does not close everything it opens, so those 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) pkg/capi/aws/api/v1beta1/awsclustertemplate_types.go:26 — pkg/capi/aws/api/v1beta1/awsclustertemplate_types.go:26-63 | pkg/capi/aws/api/v1beta2/awsclustertemplate_types.go:26-64 — `pkg/capi/aws/api/v1beta1/awsclustertemplate_types.go` and `pkg/capi/aws/api/v1beta2/awsclustertemplate_types.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 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/podmonitor.go:10 — control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/podmonitor.go:10-15 | control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/podmonitor.go:10-15 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenter/podmonitor.go:10-15 | control-plane-operator/controllers/hostedcontrolplane/v2/karpenteroperator/podmonitor.go:10-15 — `control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/podmonitor.go` and `control-plane-operator/controllers/hostedcontrolplane/v2/ignitionserver/podmonitor.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 6 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) pkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go:26 — pkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go:26-58 | pkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.go:26-59 — `pkg/capi/ibmcloud/api/v1beta1/ibmpowervsclustertemplate_types.go` and `pkg/capi/ibmcloud/api/v1beta2/ibmpowervsclustertemplate_types.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 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) pkg/capi/openstack/api/v1beta1/types.go:146 — pkg/capi/openstack/api/v1beta1/types.go:146-154 | pkg/capi/openstack/api/v1beta1/types.go:180-188 | pkg/capi/openstack/api/v1beta1/types.go:257-265 | pkg/capi/openstack/api/v1beta2/types.go:190-198 | pkg/capi/openstack/api/v1beta2/types.go:230-238 | pkg/capi/openstack/api/v1beta2/types.go:330-338 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) control-plane-operator/controllers/hostedcontrolplane/v2/cno/azure.go:10 — control-plane-operator/controllers/hostedcontrolplane/v2/cno/azure.go:10-14 | control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/azure.go:10-14 | control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/azure.go:10-14 | control-plane-operator/controllers/hostedcontrolplane/v2/storage/azure.go:66-70 | control-plane-operator/controllers/hostedcontrolplane/v2/storage/azure.go:83-87 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (75 lines × 2) · ×1
  • Duplicated block (75 lines × 2) pkg/capi/aws/exp/api/v1beta1/types.go:29 — pkg/capi/aws/exp/api/v1beta1/types.go:29-103 | pkg/capi/aws/exp/api/v1beta2/types.go:28-102 — `pkg/capi/aws/exp/api/v1beta1/types.go` and `pkg/capi/aws/exp/api/v1beta2/types.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 124 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/aws/exp/api/v1beta1/types.go:29` 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.
D4 · Code Duplication · Duplicated block (70 lines × 2) · ×1
  • Duplicated block (70 lines × 2) pkg/capi/openstack/api/v1beta1/types.go:511 — pkg/capi/openstack/api/v1beta1/types.go:511-580 | pkg/capi/openstack/api/v1beta2/types.go:611-682 — `pkg/capi/openstack/api/v1beta1/types.go` and `pkg/capi/openstack/api/v1beta2/types.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 372 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a 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 `pkg/capi/openstack/api/v1beta1/types.go:511` 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.
D4 · Code Duplication · Duplicated block (10 lines × 7) · ×1
  • Duplicated block (10 lines × 7) control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:600 — control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:600-609 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:647-656 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:786-795 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:806-815 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:872-881 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:907-916 | control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:945-954 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/hostedclusterconfigoperator/controllers/resources/rbac/reconcile.go:600` 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.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1980 — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1980-1988 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2004-2012 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2027-2035 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2061-2067 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2082-2088 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2157-2163 | control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:2190-2196 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:1980` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) hypershift-operator/controllers/nodepool/aws.go:474 — hypershift-operator/controllers/nodepool/aws.go:474-479 | hypershift-operator/controllers/nodepool/aws.go:494-499 | hypershift-operator/controllers/nodepool/gcp.go:65-70 | hypershift-operator/controllers/nodepool/kubevirt.go:79-84 | hypershift-operator/controllers/nodepool/openstack.go:57-62 | hypershift-operator/controllers/nodepool/powervs.go:172-177 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `hypershift-operator/controllers/nodepool/aws.go:474` 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.
X2 · Cancellation propagation · Function without context.Context · ×1
  • Function without context.Context: makeRequest hack/tools/release/notes.go:134 — `makeRequest` 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, …)`.
Minor — 243 finding(s)
D41 · Kernel & Syscall Confinement · No seccomp profile · ×55
  • 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:70 — 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:99 — 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: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: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: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: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 control-plane-operator/controllers/hostedcontrolplane/v2/assets/cloud-credential-operator/deployment.yaml: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: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: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: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: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: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: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.
  • + 30 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×48
  • Orphaned file cmd/cluster/powervs/create.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 api/scheduling/v1alpha1/clustersizingconfiguration_types.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 hypershift-operator/controllers/nodepool/kubevirt/imagecacher.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 control-plane-operator/controllers/hostedcontrolplane/v2/autoscaler/deployment.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 control-plane-pki-operator/certificatesigningcontroller/certificatesigningcontroller.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 control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/etcdcli/health.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 control-plane-operator/controllers/hostedcontrolplane/kas_pki_setup.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 cmd/infra/powervs/service_id.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 hypershift-operator/controllers/hostedclustersizing/setup.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 cmd/infra/powervs/validate.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 cmd/nodepool/openstack/create.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/etcdcli/etcdcli_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 control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/capi/ibmcloud/api/v1beta1/ibmvpcmachine_types.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 control-plane-pki-operator/certificatesigningrequestapprovalcontroller/certificatesigningrequestapprovalcontroller.go:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pkg/capi/agent/v1alpha1/agentmachine_types.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 control-plane-pki-operator/targetconfigcontroller/targetconfigcontroller.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 control-plane-pki-operator/operator.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 control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/admissionpolicies.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 support/testutil/testutil.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 ignition-server/controllers/image_file_cache.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 control-plane-operator/hostedclusterconfigoperator/configmetrics/configmetrics.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 hypershift-operator/init.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.
  • + 23 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate cmd/cluster/core/destroy.go:287 — `!apierrors.IsNotFound(err) && !meta.IsNoMatchError(err)` appears character-identically in 2 files — cmd/cluster/core/destroy.go, support/controlplane-component/generic-adapter.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 REDACTED:409 — `!exists || len(konnectivityClientCert) == 0` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate REDACTED:414 — `!exists || len(konnectivityClientCertKey) == 0` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go:1245 — `apiStrategy != nil && apiStrategy.Type == hyperv1.Route && apiStrategy.Route != nil && apiStrategy.Route.Hostname != ""` appears character-identically in 2 files — control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go, control-plane-operator/controllers/gcpprivateserviceconnect/psc_endpoint_controller.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 cmd/cluster/core/destroy.go:110 — `apierrors.IsNotFound(err) || meta.IsNoMatchError(err)` appears character-identically in 3 files — cmd/cluster/core/destroy.go, REDACTED, support/k8sutil/object.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 cmd/cluster/core/create.go:933 — `apierrors.IsTimeout(err) || apierrors.IsServerTimeout(err) || apierrors.IsInternalError(err) || apierrors.IsTooManyRequests(err) || apierror…` appears character-identically in 2 files — cmd/cluster/core/create.go, karpenter-operator/crd_wait.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 control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:989 — `availableCondition != nil && availableCondition.Status == metav1.ConditionTrue` appears character-identically in 2 files — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go, support/controlplane-component/status.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 REDACTED:1027 — `availableCondition.Status == metav1.ConditionTrue && !isHasBeenAvailableAnnotationSet` appears character-identically in 2 files — REDACTED, hypershift-operator/controllers/hostedcluster/reconcile_legacy.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 pkg/capi/aws/api/v1beta1/bastion.go:30 — `b.DisableIngressRules && len(b.AllowedCIDRBlocks) > 0` appears character-identically in 2 files — pkg/capi/aws/api/v1beta1/bastion.go, pkg/capi/aws/api/v1beta2/bastion.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 pkg/capi/aws/api/v1beta1/network_types.go:112 — `b.Name != "" && !Tags(b.Tags).HasOwned(clusterName)` appears character-identically in 2 files — pkg/capi/aws/api/v1beta1/network_types.go, pkg/capi/aws/api/v1beta2/network_types.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 hypershift-operator/controllers/hostedcluster/metrics/metrics.go:333 — `c.lastCollectTime.Before(t) && (t.Before(currentCollectTime) || t.Equal(currentCollectTime))` appears character-identically in 2 files — hypershift-operator/controllers/hostedcluster/metrics/metrics.go, hypershift-operator/controllers/nodepool/metrics/metrics.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 REDACTED:1263 — `cond.Type == appsv1.DeploymentAvailable && cond.Status == corev1.ConditionTrue` appears character-identically in 2 files — REDACTED, hypershift-operator/controllers/hostedcluster/reconcile_legacy.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 REDACTED:677 — `cond.Type == corev1.DisruptionTarget && cond.Status == corev1.ConditionTrue && cond.Reason == "DeletionByTaintManager"` appears character-identically in 2 files — REDACTED, hypershift-operator/controllers/hostedcluster/etcd_recovery.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 control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:380 — `condition != nil && condition.Status == metav1.ConditionTrue` appears character-identically in 3 files — control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go, hypershift-operator/controllers/hostedcluster/metrics/metrics.go, hypershift-operator/controllers/nodepool/version.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 REDACTED:1286 — `condition == nil || condition.ObservedGeneration != hcluster.Generation || condition.Status != metav1.ConditionTrue` appears character-identically in 2 files — REDACTED, hypershift-operator/controllers/hostedcluster/reconcile_legacy.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 hypershift-operator/controllers/hostedcluster/metrics/metrics.go:596 — `condition == nil || condition.Status != metav1.ConditionTrue` appears character-identically in 2 files — hypershift-operator/controllers/hostedcluster/metrics/metrics.go, support/controlplane-component/status.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 hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go:232 — `condition.Type == schedulingv1alpha1.ClusterSizingConfigurationValidType && condition.Status == metav1.ConditionTrue` appears character-identically in 2 files — hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_controller.go, hypershift-operator/controllers/scheduler/aws/placeholders.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 REDACTED:324 — `configOverride != nil && configOverride.Challenge != nil` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go:210 — `configuration != nil && configuration.Image != nil` appears character-identically in 3 files — control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.go, control-plane-operator/controllers/hostedcontrolplane/v2/oapi/config.go, control-plane-operator/controllers/hostedcontrolplane/v2/ocm/config.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 control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go:143 — `configuration != nil && configuration.Network != nil && len(configuration.Network.ServiceNodePortRange) > 0` appears character-identically in 2 files — control-plane-operator/controllers/hostedcontrolplane/cloud/gcp/manager.go, control-plane-operator/controllers/hostedcontrolplane/v2/kas/params.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 control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go:116 — `configuration != nil && configuration.OAuth != nil` appears character-identically in 2 files — control-plane-operator/controllers/hostedcontrolplane/v2/oauth/config.go, control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.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 control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go:120 — `cpContext.HCP.Spec.AuditWebhook != nil && len(cpContext.HCP.Spec.AuditWebhook.Name) > 0` appears character-identically in 3 files — control-plane-operator/controllers/hostedcontrolplane/v2/oapi/deployment.go, control-plane-operator/controllers/hostedcontrolplane/v2/oauth/deployment.go, control-plane-operator/controllers/hostedcontrolplane/v2/oauth_apiserver/deployment.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 control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms.go:95 — `encStatus == nil || encStatus.ActiveKey.Provider == ""` appears character-identically in 2 files — control-plane-operator/controllers/hostedcontrolplane/v2/kas/kms.go, control-plane-operator/controllers/hostedcontrolplane/v2/kas/secretencryption.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 REDACTED:183 — `err != nil && !apierrors.IsNotFound(err)` appears character-identically in 9 files — REDACTED, control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go, control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go, control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.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 hypershift-operator/controllers/ignitionpayload/config.go:104 — `err != nil && !coreerrors.Is(err, io.EOF)` appears character-identically in 4 files — hypershift-operator/controllers/ignitionpayload/config.go, hypershift-operator/controllers/nodepool/config.go, hypershift-operator/controllers/nodepool/nto.go, hypershift-operator/controllers/nodepool/osstream.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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging sync-global-pullsecret/sync-global-pullsecret.go:240 — `Info` at line 240 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 REDACTED:398 — `Info` at line 398 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 REDACTED:409 — `Info` at line 409 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 REDACTED:429 — `Info` at line 429 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 support/imageregistry/imagemetadata.go:555 — `Info` at line 555 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 support/capi-crdmigrator/crd_migrator.go:351 — `Info` at line 351 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 support/capi-crdmigrator/crd_migrator.go:403 — `Info` at line 403 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 REDACTED:290 — `Info` at line 290 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 REDACTED:301 — `Info` at line 301 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 REDACTED:412 — `Info` at line 412 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 REDACTED:423 — `Info` at line 423 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 REDACTED:458 — `Info` at line 458 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 hypershift-operator/controllers/nodepool/kubevirt/imagecacher.go:200 — `Error` at line 200 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.
  • Interpolated log message defeats structured logging hypershift-operator/controllers/hostedcluster/network_policies.go:823 — `Info` at line 823 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 control-plane-operator/main.go:469 — `Error` at line 469 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.
  • Interpolated log message defeats structured logging control-plane-operator/main.go:476 — `Error` at line 476 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.
  • Interpolated log message defeats structured logging control-plane-operator/main.go:483 — `Error` at line 483 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.
  • Interpolated log message defeats structured logging control-plane-operator/main.go:490 — `Error` at line 490 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.
  • Interpolated log message defeats structured logging control-plane-operator/hostedclusterconfigoperator/controllers/usercabundle/usercabundle.go:55 — `Info` at line 55 is handed a message assembled at the call — `fmt.Sprintf` with values, or a string concatenated with a value — so the logger receives one finished string: the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass a constant message and the values as attributes instead: `slog.Info("order moved", "order_id", orderID, "status", status)` with log/slog, `logger.Info("order moved", zap.String("order_id", orderID))` with zap, `log.WithFields(log.Fields{"order_id": orderID}).Info("order moved")` with logrus, or `log.Info().Str("order_id", orderID).Msg("order moved")` with zerolog.
  • Interpolated log message defeats structured logging control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:378 — `Info` at line 378 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 control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:1439 — `Error` at line 1439 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.
  • Interpolated log message defeats structured logging control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go:3143 — `Info` at line 3143 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 control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:168 — `Info` at line 168 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 control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go:223 — `Info` at line 223 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 control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go:389 — `Info` at line 389 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.
  • + 15 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
M2 · Architecture documentation · Architecture diagram out of date · ×5
  • Architecture diagram out of date docs/content/reference/cluster-teardown-roadmap.md:28 — `docs/content/reference/cluster-teardown-roadmap.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `kubeconfig`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/content/reference/controller-architecture.md:18 — `docs/content/reference/controller-architecture.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `destroy`, `iam`, `kubeconfig`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/content/getting-started/onboarding/lifecycle.md:14 — `docs/content/getting-started/onboarding/lifecycle.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/content/images/cluster-lifecycle/startup-debugging-decision-tree.mmd:1 — `docs/content/images/cluster-lifecycle/startup-debugging-decision-tree.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `cluster`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
  • Architecture diagram out of date docs/content/images/cluster-lifecycle/startup-dependency-graph.mmd:1 — `docs/content/images/cluster-lifecycle/startup-dependency-graph.mmd` draws the system's parts, and the drawing no longer matches the code: it leaves out `create`, `destroy`, `iam`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (153265 LoC, 947 module-visible types across 364 directories) overshoots its size bounds. 4 of 21 build unit(s) (Go, Python) overshoot their size bounds, lowering Project Cohesion to 6.2/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.
  • Projects may be oversized for their cohesion REDACTED:1 — `api` (12181 LoC, 391 module-visible types across 13 directories) overshoots its size bounds. 4 of 21 build unit(s) (Go, Python) overshoot their size bounds, lowering Project Cohesion to 6.2/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.
  • Projects may be oversized for their cohesion REDACTED:1 — `hack/tools` (6877 LoC, 25 module-visible types across 21 directories) overshoots its size bounds. 4 of 21 build unit(s) (Go, Python) overshoot their size bounds, lowering Project Cohesion to 6.2/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.
  • Projects may be oversized for their cohesion REDACTED:1 — `pkg/capi/aws` (6406 LoC, 240 module-visible types across 4 directories) overshoots its size bounds. 4 of 21 build unit(s) (Go, Python) overshoot their size bounds, lowering Project Cohesion to 6.2/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.
X7 · Silent fallback defaults · Silent fallback default on error · ×3
  • Silent fallback default on error cmd/consolelogs/azure/journals.go:203 — `normalizedProviderID` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error REDACTED:285 — `memberName` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
  • Silent fallback default on error support/upsert/apply.go:313 — `computeDesiredHash` 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.
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 15 significant file(s) lose their only recent owner: hypershift-operator/controllers/platform/azure/controller.go, api/hypershift/v1beta1/azureprivatelinkservice_types.go, kubevirtexternalinfra/externalinfra.go, control-plane-operator/controllers/azureprivatelinkservice/observer.go, cmd/infra/azure/create_iam.go, cmd/infra/azure/destroy_iam.go, control-plane-operator/hostedclusterconfigoperator/controllers/resources/azure/azure.go, control-plane-operator/hostedclusterconfigoperator/controllers/webhookvalidation/webhookvalidation.go (+7 more). 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: hack/tools/scripts/update_trusted_task_bundles.py, hack/tools/check-konflux-triggers/main.go, contrib/ci/gocacheprog/main.go. Pair on, review, or document these before any departure.
D21 · Naming Consistency · `GlobalPullSecretDSName` spells `DS` where 34 names in the project spell it `Ds` · ×2
  • `GlobalPullSecretDSName` spells `DS` where 34 names in the project spell it `Ds` control-plane-operator/hostedclusterconfigoperator/controllers/resources/manifests/pullsecret.go:9 — 34 of 36 names in project github.com/openshift/hypershift spell the token `Ds` (34 of 36; unit: names in project github.com/openshift/hypershift containing `Ds`). Peers: CreateInfraOptions.createProxyResources(publicSubnetIDs) (cmd/infra/aws/create.go:416); CreateInfraOptions.shareSubnets(publicSubnetIDs) (cmd/infra/aws/create.go:613); CreateInfraOptions.CreatePublicRouteTable(subnetIDs) (cmd/infra/aws/ec2.go:480); install.crdIncludeFilter(existingIPAMCRDs) (cmd/install/install.go:993); install.setupCRDs (cmd/install/install.go:1054). Rename to `GlobalPullSecretDsName`. [rule N6]
  • `GlobalPullSecretDSName` spells `DS` where 34 names in the project spell it `Ds` pkg/manifests/hcco/pullsecret.go:10 — 34 of 36 names in project github.com/openshift/hypershift spell the token `Ds` (34 of 36; unit: names in project github.com/openshift/hypershift containing `Ds`). Peers: CreateInfraOptions.createProxyResources(publicSubnetIDs) (cmd/infra/aws/create.go:416); CreateInfraOptions.shareSubnets(publicSubnetIDs) (cmd/infra/aws/create.go:613); CreateInfraOptions.CreatePublicRouteTable(subnetIDs) (cmd/infra/aws/ec2.go:480); install.crdIncludeFilter(existingIPAMCRDs) (cmd/install/install.go:993); install.setupCRDs (cmd/install/install.go:1054). Rename to `GlobalPullSecretDsName`. [rule N6]
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 18 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 (44 single-owned of 610 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; 610 of the 1148 production source files in this repository met that bar). They are anonymized user #3 (4 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (1 file(s)) (+12 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: control-plane-operator/hostedclusterconfigoperator/controllers/usercabundle/usercabundle.go, control-plane-operator/controllers/hostedcontrolplane/pki/konnectivity.go, support/statuspatching/statuspatching.go, control-plane-operator/hostedclusterconfigoperator/controllers/usercabundle/setup.go, pkg/etcdcli/etcdcli.go, hack/verify-tekton-pipeline-pairs.py, control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go, support/forwarder/forwarder.go (+17 more).
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no build, run or usage example ignition-server/README.md:1 — `ignition-server` is a command package (`package main` in module `github.com/openshift/hypershift`) and neither `ignition-server/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found REDACTED:17 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 17).
D21 · Naming Consistency · `DirectKubeApiServiceAccess` spells `Api` where 178 names in the project spell it `API` · ×1
  • `DirectKubeApiServiceAccess` spells `Api` where 178 names in the project spell it `API` REDACTED:83 — 178 of 181 names in project github.com/openshift/hypershift spell the token `API` (178 of 181; unit: names in project github.com/openshift/hypershift containing `API`). Peers: availabilityprober.isAPIInAPIs (REDACTED:268); RawCreateOptions.SkipAPIBudgetVerification (cmd/cluster/core/create.go:234); RawCreateOptions.KubeAPIServerDNSName (cmd/cluster/core/create.go:242); core.GetAPIServerAddressByNode (cmd/cluster/core/create.go:779); core.isTransientAPIError (cmd/cluster/core/create.go:932). Rename to `DirectKubeAPIServiceAccess`. [rule N6]
D21 · Naming Consistency · `DrOidcIamOptions` spells `Iam` where 44 names in the project spell it `IAM` · ×1
  • `DrOidcIamOptions` spells `Iam` where 44 names in the project spell it `IAM` REDACTED:84 — 44 of 46 names in project github.com/openshift/hypershift spell the token `IAM` (44 of 46; unit: names in project github.com/openshift/hypershift containing `IAM`). Peers: aws.CreateIAMOptions (cmd/cluster/aws/create.go:609); AWSPlatformDestroyOptions.PreserveIAM (cmd/cluster/core/destroy.go:67); github.com/openshift/hypershift/cmd/infra/aws.CreateIAMOptions (cmd/infra/aws/create_iam.go:30); CreateIAMOptions.additionalIAMTags (cmd/infra/aws/create_iam.go:49); github.com/openshift/hypershift/cmd/infra/aws.CreateIAMOutput (cmd/infra/aws/create_iam.go:62). Rename to `DrOidcIAMOptions`. [rule N6]
D21 · Naming Consistency · `NewDrOidcIamCommand` spells `Iam` where 44 names in the project spell it `IAM` · ×1
  • `NewDrOidcIamCommand` spells `Iam` where 44 names in the project spell it `IAM` REDACTED:109 — 44 of 46 names in project github.com/openshift/hypershift spell the token `IAM` (44 of 46; unit: names in project github.com/openshift/hypershift containing `IAM`). Peers: aws.CreateIAMOptions (cmd/cluster/aws/create.go:609); AWSPlatformDestroyOptions.PreserveIAM (cmd/cluster/core/destroy.go:67); github.com/openshift/hypershift/cmd/infra/aws.CreateIAMOptions (cmd/infra/aws/create_iam.go:30); CreateIAMOptions.additionalIAMTags (cmd/infra/aws/create_iam.go:49); github.com/openshift/hypershift/cmd/infra/aws.CreateIAMOutput (cmd/infra/aws/create_iam.go:62). Rename to `NewDrOidcIAMCommand`. [rule N6]
D21 · Naming Consistency · `AccessKeyId` spells `Id` where 425 names in the project spell it `ID` · ×1
  • `AccessKeyId` spells `Id` where 425 names in the project spell it `ID` cmd/infra/aws/util/sts.go:89 — 425 of 430 names in project github.com/openshift/hypershift spell the token `ID` (425 of 430; unit: names in project github.com/openshift/hypershift containing `ID`). Peers: CreateBastionOpts.InfraID (cmd/bastion/aws/create.go:37); aws.ensureBastionSecurityGroup(infraID) (cmd/bastion/aws/create.go:213); aws.existingSecurityGroup(infraID) (cmd/bastion/aws/create.go:328); aws.existingVPC(infraID) (cmd/bastion/aws/create.go:351); aws.ensureBastionKeyPair(infraID) (cmd/bastion/aws/create.go:376). Rename to `AccessKeyID`. [rule N6]
D21 · Naming Consistency · `VPCCidr` spells `Cidr` where 27 names in the project spell it `CIDR` · ×1
  • `VPCCidr` spells `Cidr` where 27 names in the project spell it `CIDR` cmd/infra/gcp/create_infra.go:27 — 27 of 28 names in project github.com/openshift/hypershift spell the token `CIDR` (27 of 28; unit: names in project github.com/openshift/hypershift containing `CIDR`). Peers: RawCreateOptions.ServiceCIDR (cmd/cluster/core/create.go:222); RawCreateOptions.ClusterCIDR (cmd/cluster/core/create.go:223); RawCreateOptions.MachineCIDR (cmd/cluster/core/create.go:224); powervs.defaultCIDRBlock (cmd/cluster/powervs/create.go:26); CreateInfraOutput.MachineCIDR (cmd/infra/aws/create.go:70). Rename to `VPCCIDR`. [rule N6]
D21 · Naming Consistency · `cloudApiKey` spells `Api` where 178 names in the project spell it `API` · ×1
  • `cloudApiKey` spells `Api` where 178 names in the project spell it `API` cmd/infra/powervs/create.go:104 — 178 of 181 names in project github.com/openshift/hypershift spell the token `API` (178 of 181; unit: names in project github.com/openshift/hypershift containing `API`). Peers: availabilityprober.isAPIInAPIs (REDACTED:268); RawCreateOptions.SkipAPIBudgetVerification (cmd/cluster/core/create.go:234); RawCreateOptions.KubeAPIServerDNSName (cmd/cluster/core/create.go:242); core.GetAPIServerAddressByNode (cmd/cluster/core/create.go:779); core.isTransientAPIError (cmd/cluster/core/create.go:932). Rename to `cloudAPIKey`. [rule N6]
D21 · Naming Consistency · `resourceId` spells `Id` where 425 names in the project spell it `ID` · ×1
  • `resourceId` spells `Id` where 425 names in the project spell it `ID` cmd/infra/powervs/create.go:1249 — 425 of 430 names in project github.com/openshift/hypershift spell the token `ID` (425 of 430; unit: names in project github.com/openshift/hypershift containing `ID`). Peers: CreateBastionOpts.InfraID (cmd/bastion/aws/create.go:37); aws.ensureBastionSecurityGroup(infraID) (cmd/bastion/aws/create.go:213); aws.existingSecurityGroup(infraID) (cmd/bastion/aws/create.go:328); aws.existingVPC(infraID) (cmd/bastion/aws/create.go:351); aws.ensureBastionKeyPair(infraID) (cmd/bastion/aws/create.go:376). Rename to `resourceID`. [rule N6]
D21 · Naming Consistency · `vpcLbNamePrefix` spells `Lb` where 13 names in the project spell it `LB` · ×1
  • `vpcLbNamePrefix` spells `Lb` where 13 names in the project spell it `LB` cmd/infra/powervs/destroy.go:52 — 13 of 14 names in project github.com/openshift/hypershift spell the token `LB` (13 of 14; unit: names in project github.com/openshift/hypershift containing `LB`). Peers: CreateInfraOptions.createDNSAndLBResources (cmd/infra/azure/create.go:308); NetworkManager.CreatePublicIPAddressForLB (cmd/infra/azure/networking.go:765); powervs.destroyVpcLB (cmd/infra/powervs/destroy.go:609); resources.netLBFinalizerV2 (control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp_lb_service_annotations.go:21); resources.netLBFinalizerV3 (control-plane-operator/hostedclusterconfigoperator/controllers/resources/gcp_lb_service_annotations.go:22). Rename to `vpcLBNamePrefix`. [rule N6]
D21 · Naming Consistency · `TxtOwnerId` spells `Id` where 425 names in the project spell it `ID` · ×1
  • `TxtOwnerId` spells `Id` where 425 names in the project spell it `ID` cmd/install/assets/hypershift_operator.go:268 — 425 of 430 names in project github.com/openshift/hypershift spell the token `ID` (425 of 430; unit: names in project github.com/openshift/hypershift containing `ID`). Peers: CreateBastionOpts.InfraID (cmd/bastion/aws/create.go:37); aws.ensureBastionSecurityGroup(infraID) (cmd/bastion/aws/create.go:213); aws.existingSecurityGroup(infraID) (cmd/bastion/aws/create.go:328); aws.existingVPC(infraID) (cmd/bastion/aws/create.go:351); aws.ensureBastionKeyPair(infraID) (cmd/bastion/aws/create.go:376). Rename to `TxtOwnerID`. [rule N6]
D21 · Naming Consistency · `ExternalDNSTxtOwnerId` spells `Id` where 425 names in the project spell it `ID` · ×1
  • `ExternalDNSTxtOwnerId` spells `Id` where 425 names in the project spell it `ID` cmd/install/install.go:132 — 425 of 430 names in project github.com/openshift/hypershift spell the token `ID` (425 of 430; unit: names in project github.com/openshift/hypershift containing `ID`). Peers: CreateBastionOpts.InfraID (cmd/bastion/aws/create.go:37); aws.ensureBastionSecurityGroup(infraID) (cmd/bastion/aws/create.go:213); aws.existingSecurityGroup(infraID) (cmd/bastion/aws/create.go:328); aws.existingVPC(infraID) (cmd/bastion/aws/create.go:351); aws.ensureBastionKeyPair(infraID) (cmd/bastion/aws/create.go:376). Rename to `ExternalDNSTxtOwnerID`. [rule N6]
D21 · Naming Consistency · `SLOsAlerts` spells `Os` where 12 names in the project spell it `OS` · ×1
  • `SLOsAlerts` spells `Os` where 12 names in the project spell it `OS` cmd/install/install.go:147 — 12 of 13 names in project github.com/openshift/hypershift spell the token `OS` (12 of 13; unit: names in project github.com/openshift/hypershift containing `OS`). Peers: AzurePlatformCreateOptions.EnableEphemeralOSDisk (cmd/nodepool/azure/create.go:28); util.EnableEphemeralOSDiskDescription (cmd/util/azure_flag_descriptions.go:61); nodepool.validateOSImageStream (hypershift-operator/controllers/nodepool/osstream.go:118); nodepool.TokenSecretOSStreamKey (hypershift-operator/controllers/nodepool/token.go:48); nodepool.rhcosOSImageRe (hypershift-operator/controllers/nodepool/version.go:105). Rename to `SLOSAlerts`. [rule N6]
D21 · Naming Consistency · `reconcileAROPrivateRouterService` spells `ARO` where 12 names in the project spell it `Aro` · ×1
  • `reconcileAROPrivateRouterService` spells `ARO` where 12 names in the project spell it `Aro` control-plane-operator/controllers/hostedcontrolplane/infra/infra.go:495 — 12 of 13 names in project github.com/openshift/hypershift spell the token `Aro` (12 of 13; unit: names in project github.com/openshift/hypershift containing `Aro`). Peers: azure.isAroHCP (control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/component.go:92); cno.isAroHCP (control-plane-operator/controllers/hostedcontrolplane/v2/cno/component.go:79); ingressoperator.isAroHCP (control-plane-operator/controllers/hostedcontrolplane/v2/ingressoperator/component.go:89); registryoperator.isAroHCP (control-plane-operator/controllers/hostedcontrolplane/v2/registryoperator/component.go:66); storage.isAroHCP (control-plane-operator/controllers/hostedcontrolplane/v2/storage/component.go:116). Rename to `reconcileAroPrivateRouterService`. [rule N6]
D21 · Naming Consistency · `isManagedETCD` spells `ETCD` where 70 names in the project spell it `Etcd` · ×1
  • `isManagedETCD` spells `ETCD` where 70 names in the project spell it `Etcd` control-plane-operator/controllers/hostedcontrolplane/v2/etcd/component.go:74 — 70 of 72 names in project github.com/openshift/hypershift spell the token `Etcd` (70 of 72; unit: names in project github.com/openshift/hypershift containing `Etcd`). Peers: core.applyEtcdConfig (cmd/cluster/core/create.go:488); core.defaultEtcdShardReplicas (cmd/cluster/core/etcd_shards.go:22); core.maxEtcdShardNameLength (cmd/cluster/core/etcd_shards.go:28); core.maxEtcdShardResources (cmd/cluster/core/etcd_shards.go:32); core.parseEtcdShards (cmd/cluster/core/etcd_shards.go:49). Rename to `isManagedEtcd`. [rule N6]
D21 · Naming Consistency · `ReconcileApiUsageRule` spells `Api` where 178 names in the project spell it `API` · ×1
  • `ReconcileApiUsageRule` spells `Api` where 178 names in the project spell it `API` control-plane-operator/hostedclusterconfigoperator/controllers/resources/alerts/reconcile.go:24 — 178 of 181 names in project github.com/openshift/hypershift spell the token `API` (178 of 181; unit: names in project github.com/openshift/hypershift containing `API`). Peers: availabilityprober.isAPIInAPIs (REDACTED:268); RawCreateOptions.SkipAPIBudgetVerification (cmd/cluster/core/create.go:234); RawCreateOptions.KubeAPIServerDNSName (cmd/cluster/core/create.go:242); core.GetAPIServerAddressByNode (cmd/cluster/core/create.go:779); core.isTransientAPIError (cmd/cluster/core/create.go:932). Rename to `ReconcileAPIUsageRule`. [rule N6]
D21 · Naming Consistency · `reconcileETCDMemberRecovery` spells `ETCD` where 70 names in the project spell it `Etcd` · ×1
  • `reconcileETCDMemberRecovery` spells `ETCD` where 70 names in the project spell it `Etcd` hypershift-operator/controllers/hostedcluster/etcd_recovery.go:45 — 70 of 72 names in project github.com/openshift/hypershift spell the token `Etcd` (70 of 72; unit: names in project github.com/openshift/hypershift containing `Etcd`). Peers: core.applyEtcdConfig (cmd/cluster/core/create.go:488); core.defaultEtcdShardReplicas (cmd/cluster/core/etcd_shards.go:22); core.maxEtcdShardNameLength (cmd/cluster/core/etcd_shards.go:28); core.maxEtcdShardResources (cmd/cluster/core/etcd_shards.go:32); core.parseEtcdShards (cmd/cluster/core/etcd_shards.go:49). Rename to `reconcileEtcdMemberRecovery`. [rule N6]
D21 · Naming Consistency · `newHttpDialer` spells `Http` where 13 names in the project spell it `HTTP` · ×1
  • `newHttpDialer` spells `Http` where 13 names in the project spell it `HTTP` konnectivity-socks5-proxy/http_proxy.go:26 — 13 of 14 names in project github.com/openshift/hypershift spell the token `HTTP` (13 of 14; unit: names in project github.com/openshift/hypershift containing `HTTP`). Peers: DiagnosticsOptions.serialHTTPClient (cmd/consolelogs/azure/getlogs.go:70); oauth.externalHTTPRequestTimeout (REDACTED:46); oauth.externalHTTPRequestTimeout (REDACTED:46); resolverHandler.ServeHTTP (control-plane-operator/endpoint-resolver/server.go:45); ProxyHandler.ServeHTTP (control-plane-operator/metrics-proxy/proxy.go:36). Rename to `newHTTPDialer`. [rule N6]
D21 · Naming Consistency · `ClassicElbAttributes` spells `Elb` where 21 names in the project spell it `ELB` · ×1
  • `ClassicElbAttributes` spells `Elb` where 21 names in the project spell it `ELB` pkg/capi/aws/api/v1beta2/network_types.go:333 — 21 of 22 names in project sigs.k8s.io/cluster-api-provider-aws/v2 spell the token `ELB` (21 of 22; unit: names in project sigs.k8s.io/cluster-api-provider-aws/v2 containing `ELB`). Peers: NetworkStatus.APIServerELB (pkg/capi/aws/api/v1beta1/network_types.go:31); sigs.k8s.io/cluster-api-provider-aws/v2/api/v1beta1.ClassicELBScheme (pkg/capi/aws/api/v1beta1/network_types.go:35); v1beta1.ClassicELBSchemeInternetFacing (pkg/capi/aws/api/v1beta1/network_types.go:40); v1beta1.ClassicELBSchemeInternal (pkg/capi/aws/api/v1beta1/network_types.go:44); v1beta1.ClassicELBSchemeIncorrectInternetFacing (pkg/capi/aws/api/v1beta1/network_types.go:47). Rename to `ClassicELBAttributes`. [rule N6]
D21 · Naming Consistency · `GetSecurityGroupById` spells `Id` where 425 names in the project spell it `ID` · ×1
  • `GetSecurityGroupById` spells `Id` where 425 names in the project spell it `ID` support/awsutil/sg.go:213 — 425 of 430 names in project github.com/openshift/hypershift spell the token `ID` (425 of 430; unit: names in project github.com/openshift/hypershift containing `ID`). Peers: CreateBastionOpts.InfraID (cmd/bastion/aws/create.go:37); aws.ensureBastionSecurityGroup(infraID) (cmd/bastion/aws/create.go:213); aws.existingSecurityGroup(infraID) (cmd/bastion/aws/create.go:328); aws.existingVPC(infraID) (cmd/bastion/aws/create.go:351); aws.ensureBastionKeyPair(infraID) (cmd/bastion/aws/create.go:376). Rename to `GetSecurityGroupByID`. [rule N6]
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 48 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: cmd/cluster/powervs/create.go, REDACTED, control-plane-pki-operator/certificatesigningcontroller/certificatesigningcontroller.go, control-plane-pki-operator/certrotationcontroller/certrotationcontroller.go, pkg/etcdcli/health.go, api/scheduling/v1alpha1/clustersizingconfiguration_types.go, cmd/nodepool/openstack/create.go, pkg/etcdcli/etcdcli_pool.go (and 40 more) (50 orphaned of 613 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; 613 of the 1148 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D42 · Runtime Threat Enforcement · No runtime threat detection · ×1
  • 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.
D42 · Runtime Threat Enforcement · No admission-control policy · ×1
  • No admission-control policy — No policy-enforcement gate (Kyverno / OPA Gatekeeper / PodSecurity admission) is committed. Admission control keeps workloads that violate your security baseline from ever reaching the cluster.
M1 · Documentation (README) · Thin README · ×1
  • Thin README README.md:1 — The root README is 61 words, against a bar of 120. Of the three newcomer-critical sections this check looks for by heading, in the README and in the repository documents it links, it found no a build/run or getting-started section, no a testing section, no an architecture or project-map section. Sections are matched on HEADING text only, so material written under a heading this check does not recognise — or with no heading at all — is not seen and this row may understate what the document covers.
M2 · Architecture documentation · No ADRs · ×1
  • 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.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift docs/content/getting-started/quick-setup.md:17 — docs/content/getting-started/quick-setup.md names Go 1.19, but REDACTED:3 requires `go 1.24` (the lowest of 21 declarations): the code does not build on Go 1.19. 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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 2/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `contrib/repo_metrics`.
PF1 · Benchmark discipline · Benchmarks don't track allocations · ×1
  • Benchmarks don't track allocations hack/tools/hypershiftlinter/analyzers/testfuncstructure/testdata/src/a/good/production_test.go — A Go testing.B suite exists but nothing turns on its allocation measurement — allocations (the main way hot code pressures a garbage collector or allocator) aren't being measured.
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 22/23 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.
Minor — 112 finding(s)
D12 · Dependency Hygiene · Outdated · ×112
  • Outdated: github.com/Azure/azure-sdk-for-go/sdk/azcore — `github.com/Azure/azure-sdk-for-go/sdk/azcore` is required at v1.23.1 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/Azure/azure-sdk-for-go/sdk/azidentity — `github.com/Azure/azure-sdk-for-go/sdk/azidentity` is required at v1.14.1 in REDACTED, but v1.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/Azure/azure-sdk-for-go/sdk/azidentity@v1.15.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/Azure/azure-sdk-for-go/sdk/storage/azblob — `github.com/Azure/azure-sdk-for-go/sdk/storage/azblob` is required at v1.8.1 in REDACTED, but v1.8.3 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/storage/azblob@v1.8.3 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM-Cloud/power-go-client — `github.com/IBM-Cloud/power-go-client` is required at v1.14.4 in REDACTED, but v1.17.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/IBM-Cloud/power-go-client@v1.17.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM/go-sdk-core/v5 — `github.com/IBM/go-sdk-core/v5` is required at v5.21.2 in REDACTED, but v5.25.4 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/IBM/go-sdk-core/v5@v5.25.4 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM/ibm-cos-sdk-go — `github.com/IBM/ibm-cos-sdk-go` is required at v1.12.4 in REDACTED, but v1.15.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/IBM/ibm-cos-sdk-go@v1.15.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM/networking-go-sdk — `github.com/IBM/networking-go-sdk` is required at v0.51.15 in REDACTED, but v0.56.2 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/IBM/networking-go-sdk@v0.56.2 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM/platform-services-go-sdk — `github.com/IBM/platform-services-go-sdk` is required at v0.91.0 in REDACTED, but v0.103.6 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/IBM/platform-services-go-sdk@v0.103.6 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/IBM/vpc-go-sdk — `github.com/IBM/vpc-go-sdk` is required at v0.76.2 in REDACTED, but v0.93.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/IBM/vpc-go-sdk@v0.93.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2 — `github.com/aws/aws-sdk-go-v2` is required at v1.43.0 in REDACTED, but v1.48.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/aws/aws-sdk-go-v2@v1.48.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/config — `github.com/aws/aws-sdk-go-v2/config` is required at v1.32.31 in REDACTED, but v1.33.19 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/config@v1.33.19 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/credentials — `github.com/aws/aws-sdk-go-v2/credentials` is required at v1.19.30 in REDACTED, but v1.21.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/credentials@v1.21.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager — `github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager` is required at v0.3.5 in REDACTED, but v0.5.9 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager@v0.5.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/ec2 — `github.com/aws/aws-sdk-go-v2/service/ec2` is required at v1.317.0 in REDACTED, but v1.349.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/aws/aws-sdk-go-v2/service/ec2@v1.349.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing — `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing` is required at v1.36.0 in REDACTED, but v1.42.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/aws/aws-sdk-go-v2/service/elasticloadbalancing@v1.42.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2 — `github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2` is required at v1.58.1 in REDACTED, but v1.64.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/aws/aws-sdk-go-v2/service/elasticloadbalancingv2@v1.64.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/iam — `github.com/aws/aws-sdk-go-v2/service/iam` is required at v1.56.0 in REDACTED, but v1.66.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/aws/aws-sdk-go-v2/service/iam@v1.66.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/kms — `github.com/aws/aws-sdk-go-v2/service/kms` is required at v1.55.0 in REDACTED, but v1.63.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/aws/aws-sdk-go-v2/service/kms@v1.63.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/ram — `github.com/aws/aws-sdk-go-v2/service/ram` is required at v1.39.0 in REDACTED, but v1.46.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/aws-sdk-go-v2/service/ram@v1.46.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi — `github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi` is required at v1.35.0 in REDACTED, but v1.42.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/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi@v1.42.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/route53 — `github.com/aws/aws-sdk-go-v2/service/route53` is required at v1.65.2 in REDACTED, but v1.71.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/aws/aws-sdk-go-v2/service/route53@v1.71.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/s3 — `github.com/aws/aws-sdk-go-v2/service/s3` is required at v1.106.0 in REDACTED, but v1.115.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/aws/aws-sdk-go-v2/service/s3@v1.115.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/sqs — `github.com/aws/aws-sdk-go-v2/service/sqs` is required at v1.46.0 in REDACTED, but v1.53.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/aws/aws-sdk-go-v2/service/sqs@v1.53.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/aws-sdk-go-v2/service/sts — `github.com/aws/aws-sdk-go-v2/service/sts` is required at v1.45.0 in REDACTED, but v1.52.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/aws/aws-sdk-go-v2/service/sts@v1.52.0 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: github.com/aws/smithy-go — `github.com/aws/smithy-go` is required at v1.27.3 in REDACTED, but v1.28.9 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/aws/smithy-go@v1.28.9 && go mod tidy` and commit the updated REDACTED and go.sum.
  • + 87 more in this group — see findings.md.

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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-88a01d6494614db18799e8fffbb81fea/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-88a01d6494614db18799e8fffbb81fea/history-1.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-88a01d6494614db18799e8fffbb81fea/history-2.json --exit-code 0 --source .4artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=8809" --report-format json --report-path /tmp/watchdog-gitleaks-88a01d6494614db18799e8fffbb81fea/history-3.json --exit-code 0 --source .6artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-88a01d6494614db18799e8fffbb81fea/tree.json --exit-code 0 --source .8artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude api/vendor --exclude client --exclude cmd/cluster/agent/testdata --exclude cmd/cluster/aws/testdata --exclude cmd/cluster/azure/testdata --exclude cmd/cluster/gcp/testdata --exclude cmd/cluster/kubevirt/testdata --exclude cmd/cluster/none/testdata --exclude cmd/cluster/openstack/testdata --exclude cmd/cluster/powervs/testdata --exclude cmd/install/assets/crds/hypershift-operator/zz_generated.crd-manifests --exclude cmd/install/testdata --exclude cmd/nodepool/aws/testdata --exclude cmd/nodepool/azure/testdata --exclude cmd/nodepool/gcp/testdata --exclude cmd/nodepool/kubevirt/testdata --exclude cmd/nodepool/openstack/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/ignition/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/infra/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/azure/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/gcp/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/kubevirt/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/powervs/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/kube_scheduler/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/ocm/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/routecm/testdata --exclude control-plane-operator/controllers/hostedcontrolplane/v2/router/testdata --exclude control-plane-pki-operator/certificaterevocationcontroller/testdata --exclude control-plane-pki-operator/certificatesigningcontroller/testdata --exclude hack/tools/deadcode-report/testdata --exclude hack/tools/hypershiftlinter/analyzers/contextbackground/testdata --exclude hack/tools/hypershiftlinter/analyzers/e2eutilallowlist/testdata --exclude hack/tools/hypershiftlinter/analyzers/guestcluster/testdata --exclude hack/tools/hypershiftlinter/analyzers/hcpstatuspatch/testdata --exclude hack/tools/hypershiftlinter/analyzers/ipv6url/testdata --exclude hack/tools/hypershiftlinter/analyzers/sippyannotation/testdata --exclude hack/tools/hypershiftlinter/analyzers/testcasename/testdata --exclude hack/tools/hypershiftlinter/analyzers/testfuncname/testdata --exclude hack/tools/hypershiftlinter/analyzers/testfuncstructure/testdata --exclude hack/tools/hypershiftlinter/analyzers/vacuouspass/testdata --exclude hack/tools/vendor --exclude hypershift-operator/controllers/hostedcluster/testdata --exclude hypershift-operator/controllers/manifests/controlplanepkioperator/testdata --exclude hypershift-operator/controllers/nodepool/apiserver-haproxy/testdata --exclude karpenter-operator/controllers/karpenter/assets/zz_generated.crd-manifests --exclude kas-bootstrap/testdata --exclude pkg/capi/agent/capicore --exclude pkg/capi/aws/capicore --exclude pkg/capi/azure/capicore --exclude pkg/capi/gcp/capicore --exclude pkg/capi/ibmcloud/capicore --exclude pkg/capi/kubevirt/capicore --exclude pkg/capi/openstack/capicore --exclude product-cli/cmd/cluster/agent/testdata --exclude product-cli/cmd/cluster/aws/testdata --exclude product-cli/cmd/cluster/azure/testdata --exclude product-cli/cmd/cluster/kubevirt/testdata --exclude product-cli/cmd/cluster/openstack/testdata --exclude product-cli/cmd/nodepool/agent/testdata --exclude product-cli/cmd/nodepool/aws/testdata --exclude product-cli/cmd/nodepool/azure/testdata --exclude product-cli/cmd/nodepool/kubevirt/testdata --exclude product-cli/cmd/nodepool/openstack/testdata --exclude sharedingress-config-generator/testdata --exclude support/awsapi --exclude support/gmpmonitoring/testdata --exclude support/metrics/testdata --exclude test/e2e/v2/cmd/run-tests/testdata --exclude test/integration/framework/testdata --exclude vendor .147artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-5458498bc81e4ad9b918281803551a1877artifacts/raw/osv-scanner.json
D32 · Data Compliance (PII/GDPR)semgrep—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.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-5458498bc81e4ad9b918281803551a180artifacts/raw/osv-scanner.json

Run 01a1eb51-9170-7e82-998d-33ecf88ad163 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

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.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md