Public report of podman-container-tools/podman, published 24 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 24 October 2026, 03:22 UTC · Survey ID cd_4058ee04cbdd4cbcbc5f4eaaf0ad3693
podman-container-tools/podman
Measured 24 October 2026, 03:13 UTC, at code version eeeb322
No regression since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 166,076 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 2.5 person-years · Weakest lens: Code Health, 52
Findings by how serious they are
18 critical1535 serious122 minor
16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 03:13 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
70of 74 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
1661of 1675 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
74dimensions across 7 lenses, read from 166,076 lines of product code in 2 projects.
podman-container-tools/podman scores 60 out of 100 and is rated Adequate, while five of its seven lenses score higher still: Architecture at 85, Production Readiness at 75 and Security and Compliance at 66, all rated Adequate, and Maturity at 81 and Performance at 80, both rated Strong.
The score is lower than those five because the weakest lens counts most, and here that is Code Health, which scores 52 and is rated Adequate. Its Cyclomatic Complexity dimension scores 2 out of 10, and until that reaches 4, Code Health can't be rated higher than Adequate. The first actions are to adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient` and to bring the 198 bodies over 30 down to 30 or less in Cognitive Complexity, and if Code Health rose to 70, the score would rise from 60 to about 66.
18 findings are critical: ten in Static Analysis (SAST), six in Secrets (history) and two in IaC & Container Security.
Watchdog couldn't measure 15 dimensions in this code, among them Code Coverage, Test Reliability and Internal API Consistency, so they are left out of the score. The product code is 166,076 lines, which would take an estimated 2.5 person-years, around €370,000, to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 48 findings
These 48 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one.
Dependency Vulnerabilities · Medium CVE: GO-2026-4970 REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/bindings/images/rm.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/criu/criu_linux.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/volumes.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/containers.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/filters/containers.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/infra/abi/quadlet.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/infra/abi/pods.go
Exception handling · Swallowed exception (caught, then discarded) pkg/domain/infra/abi/play.go
Exception handling · Swallowed exception (caught, then discarded) pkg/k8s.io/apimachinery/pkg/api/resource/suffix.go
Exception handling · Swallowed exception (caught, then discarded) pkg/lookup/lookup.go
Exception handling · Swallowed exception (caught, then discarded) pkg/lookup/lookup.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/machine_windows.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/ports/ports.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/qemu/machine.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/networking.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/wsl/wutil/wutil.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/wsl/wutil/wutil.go
Exception handling · Swallowed exception (caught, then discarded) pkg/machine/wsl/wutil/wutil.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/specgen/generate/pod_create.go
Exception handling · Swallowed exception (caught, then discarded) pkg/specgen/generate/oci_linux.go
Exception handling · Swallowed exception (caught, then discarded) pkg/specgen/generate/container.go
Exception handling · Swallowed exception (caught, then discarded) pkg/systemd/parser/unitfile.go
Rebuild cost: about €370,000 · Estimate
Cost to rebuild
€120,000 to €610,000, for 2,028 to 6,434 hours of work, about 2.5 person-years for 1 to 5 engineers
Difficulty of the problem
High, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 60. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 166,076 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`.
Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Bring the 198 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 233), ContainerEngine.playKubePod (cognitive 231).
Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with specgenutil.FillOutSpecGen (cyclomatic 199), Container.generateSpec (cyclomatic 157), ContainerEngine.playKubePod (cyclomatic 129).
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €370,000 to build again, about 2.5 person-years of work. Its weakest lens is Code Health, at 52 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Of all the actions in this report, it raises the score most for the work it takes: about 6 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.6 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 24,926 lines over the last 90 days, which is about 101,089 lines a year. At that pace, the extra work comes to an estimated 15.4 to 92.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 Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: 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.
172 modules, with 218 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 132 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.
io/podman/v6/cmd/quadlet uses io/podman/v6/pkg/logiface, so a change to io/podman/v6/pkg/logiface can break io/podman/v6/cmd/quadlet, while a change to io/podman/v6/cmd/quadlet can't break io/podman/v6/pkg/logiface.
Position
Below the diagonal: io/podman/v6/cmd/quadlet uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/ignition uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/ignition, while a change to io/podman/v6/pkg/machine/ignition can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/ignition uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/qemu/command uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/qemu/command, while a change to io/podman/v6/pkg/machine/qemu/command can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/qemu/command uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/specgen uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/specgen, while a change to io/podman/v6/pkg/specgen can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/specgen uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities/types uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/domain/entities/types, while a change to io/podman/v6/pkg/domain/entities/types can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities/types uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities/types uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/domain/entities/types, while a change to io/podman/v6/pkg/domain/entities/types can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities/types uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities/types uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/pkg/domain/entities/types, while a change to io/podman/v6/pkg/domain/entities/types can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities/types uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/vmconfigs uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/vmconfigs, while a change to io/podman/v6/pkg/machine/vmconfigs can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/vmconfigs uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/vmconfigs uses io/podman/v6/pkg/machine/ignition, so a change to io/podman/v6/pkg/machine/ignition can break io/podman/v6/pkg/machine/vmconfigs, while a change to io/podman/v6/pkg/machine/vmconfigs can't break io/podman/v6/pkg/machine/ignition.
Position
Below the diagonal: io/podman/v6/pkg/machine/vmconfigs uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/vmconfigs uses io/podman/v6/pkg/machine/qemu/command, so a change to io/podman/v6/pkg/machine/qemu/command can break io/podman/v6/pkg/machine/vmconfigs, while a change to io/podman/v6/pkg/machine/vmconfigs can't break io/podman/v6/pkg/machine/qemu/command.
Position
Below the diagonal: io/podman/v6/pkg/machine/vmconfigs uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/utils uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/cmd/podman/utils, while a change to io/podman/v6/cmd/podman/utils can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/cmd/podman/utils uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/utils uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/utils, while a change to io/podman/v6/cmd/podman/utils can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/utils uses a module listed above it, which is the healthy direction.
io/podman/v6/internal/localapi uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/internal/localapi, while a change to io/podman/v6/internal/localapi can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/internal/localapi uses a module listed above it, which is the healthy direction.
io/podman/v6/internal/localapi uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/internal/localapi, while a change to io/podman/v6/internal/localapi can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/internal/localapi uses a module listed above it, which is the healthy direction.
io/podman/v6/internal/localapi uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/internal/localapi, while a change to io/podman/v6/internal/localapi can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/internal/localapi uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/images uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/bindings/images, while a change to io/podman/v6/pkg/bindings/images can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/bindings/images uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/images uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/bindings/images, while a change to io/podman/v6/pkg/bindings/images can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/bindings/images uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/kube uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/bindings/kube, while a change to io/podman/v6/pkg/bindings/kube can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/bindings/kube uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/domain/entities, while a change to io/podman/v6/pkg/domain/entities can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities uses io/podman/v6/libpod/events, so a change to io/podman/v6/libpod/events can break io/podman/v6/pkg/domain/entities, while a change to io/podman/v6/pkg/domain/entities can't break io/podman/v6/libpod/events.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/domain/entities, while a change to io/podman/v6/pkg/domain/entities can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/entities uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/pkg/domain/entities, while a change to io/podman/v6/pkg/domain/entities can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities uses a module listed above it, which is the healthy direction.
80 pairs of types, where a type in io/podman/v6/pkg/domain/entities uses a type in io/podman/v6/pkg/domain/entities/types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/domain/entities uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/domain/entities, while a change to io/podman/v6/pkg/domain/entities can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/domain/entities uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine, while a change to io/podman/v6/pkg/machine can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine uses io/podman/v6/pkg/machine/ignition, so a change to io/podman/v6/pkg/machine/ignition can break io/podman/v6/pkg/machine, while a change to io/podman/v6/pkg/machine can't break io/podman/v6/pkg/machine/ignition.
Position
Below the diagonal: io/podman/v6/pkg/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/pkg/machine, while a change to io/podman/v6/pkg/machine can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/pkg/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/hyperv uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/hyperv, while a change to io/podman/v6/pkg/machine/hyperv can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/hyperv uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/hyperv uses io/podman/v6/pkg/machine/ignition, so a change to io/podman/v6/pkg/machine/ignition can break io/podman/v6/pkg/machine/hyperv, while a change to io/podman/v6/pkg/machine/hyperv can't break io/podman/v6/pkg/machine/ignition.
Position
Below the diagonal: io/podman/v6/pkg/machine/hyperv uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/hyperv uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/pkg/machine/hyperv, while a change to io/podman/v6/pkg/machine/hyperv can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/pkg/machine/hyperv uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/qemu uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/qemu, while a change to io/podman/v6/pkg/machine/qemu can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/qemu uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/qemu uses io/podman/v6/pkg/machine/ignition, so a change to io/podman/v6/pkg/machine/ignition can break io/podman/v6/pkg/machine/qemu, while a change to io/podman/v6/pkg/machine/qemu can't break io/podman/v6/pkg/machine/ignition.
Position
Below the diagonal: io/podman/v6/pkg/machine/qemu uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/qemu uses io/podman/v6/pkg/machine/qemu/command, so a change to io/podman/v6/pkg/machine/qemu/command can break io/podman/v6/pkg/machine/qemu, while a change to io/podman/v6/pkg/machine/qemu can't break io/podman/v6/pkg/machine/qemu/command.
Position
Below the diagonal: io/podman/v6/pkg/machine/qemu uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/qemu uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/pkg/machine/qemu, while a change to io/podman/v6/pkg/machine/qemu can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/pkg/machine/qemu uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/wsl uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/wsl, while a change to io/podman/v6/pkg/machine/wsl can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/wsl uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/wsl uses io/podman/v6/pkg/machine/ignition, so a change to io/podman/v6/pkg/machine/ignition can break io/podman/v6/pkg/machine/wsl, while a change to io/podman/v6/pkg/machine/wsl can't break io/podman/v6/pkg/machine/ignition.
Position
Below the diagonal: io/podman/v6/pkg/machine/wsl uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/wsl uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/pkg/machine/wsl, while a change to io/podman/v6/pkg/machine/wsl can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/pkg/machine/wsl uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman uses io/podman/v6/pkg/logiface, so a change to io/podman/v6/pkg/logiface can break io/podman/v6/cmd/podman, while a change to io/podman/v6/cmd/podman can't break io/podman/v6/pkg/logiface.
Position
Below the diagonal: io/podman/v6/cmd/podman uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/cmd/podman, while a change to io/podman/v6/cmd/podman can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/cmd/podman uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman, while a change to io/podman/v6/cmd/podman can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/common uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/common, while a change to io/podman/v6/cmd/podman/common can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/common uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/common uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/common, while a change to io/podman/v6/cmd/podman/common can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/common uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/machine uses io/podman/v6/libpod/events, so a change to io/podman/v6/libpod/events can break io/podman/v6/cmd/podman/machine, while a change to io/podman/v6/cmd/podman/machine can't break io/podman/v6/libpod/events.
Position
Below the diagonal: io/podman/v6/cmd/podman/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/machine uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/cmd/podman/machine, while a change to io/podman/v6/cmd/podman/machine can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/cmd/podman/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/machine uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/machine, while a change to io/podman/v6/cmd/podman/machine can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/machine uses io/podman/v6/pkg/machine, so a change to io/podman/v6/pkg/machine can break io/podman/v6/cmd/podman/machine, while a change to io/podman/v6/cmd/podman/machine can't break io/podman/v6/pkg/machine.
Position
Below the diagonal: io/podman/v6/cmd/podman/machine uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/pods uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/pods, while a change to io/podman/v6/cmd/podman/pods can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/pods uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/pods uses io/podman/v6/cmd/podman/utils, so a change to io/podman/v6/cmd/podman/utils can break io/podman/v6/cmd/podman/pods, while a change to io/podman/v6/cmd/podman/pods can't break io/podman/v6/cmd/podman/utils.
Position
Below the diagonal: io/podman/v6/cmd/podman/pods uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/pods uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/pods, while a change to io/podman/v6/cmd/podman/pods can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/pods uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/system uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/cmd/podman/system, while a change to io/podman/v6/cmd/podman/system can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/cmd/podman/system uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/system uses io/podman/v6/libpod/events, so a change to io/podman/v6/libpod/events can break io/podman/v6/cmd/podman/system, while a change to io/podman/v6/cmd/podman/system can't break io/podman/v6/libpod/events.
Position
Below the diagonal: io/podman/v6/cmd/podman/system uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/system uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/system, while a change to io/podman/v6/cmd/podman/system can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/system uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/system uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/system, while a change to io/podman/v6/cmd/podman/system can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/system uses a module listed above it, which is the healthy direction.
65 pairs of types, where a type in io/podman/v6/libpod uses a type in io/podman/v6/libpod/define. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/libpod uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/libpod/events, so a change to io/podman/v6/libpod/events can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/libpod/events.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/libpod/lock, so a change to io/podman/v6/libpod/lock can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/libpod/lock.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/libpod uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/libpod, while a change to io/podman/v6/libpod can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/libpod uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/api/handlers, while a change to io/podman/v6/pkg/api/handlers can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/swagger uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/api/handlers/swagger, while a change to io/podman/v6/pkg/api/handlers/swagger can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/swagger uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/swagger uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/api/handlers/swagger, while a change to io/podman/v6/pkg/api/handlers/swagger can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/swagger uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in io/podman/v6/pkg/api/handlers/swagger uses a type in io/podman/v6/pkg/domain/entities/types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/api/handlers/swagger uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/api/handlers/swagger, while a change to io/podman/v6/pkg/api/handlers/swagger can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/swagger uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/swagger uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/api/handlers/swagger, while a change to io/podman/v6/pkg/api/handlers/swagger can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/swagger uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/shim uses io/podman/v6/pkg/machine/define, so a change to io/podman/v6/pkg/machine/define can break io/podman/v6/pkg/machine/shim, while a change to io/podman/v6/pkg/machine/shim can't break io/podman/v6/pkg/machine/define.
Position
Below the diagonal: io/podman/v6/pkg/machine/shim uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/shim uses io/podman/v6/pkg/machine/vmconfigs, so a change to io/podman/v6/pkg/machine/vmconfigs can break io/podman/v6/pkg/machine/shim, while a change to io/podman/v6/pkg/machine/shim can't break io/podman/v6/pkg/machine/vmconfigs.
Position
Below the diagonal: io/podman/v6/pkg/machine/shim uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/machine/shim uses io/podman/v6/pkg/machine, so a change to io/podman/v6/pkg/machine can break io/podman/v6/pkg/machine/shim, while a change to io/podman/v6/pkg/machine/shim can't break io/podman/v6/pkg/machine.
Position
Below the diagonal: io/podman/v6/pkg/machine/shim uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/containers uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/cmd/podman/containers, while a change to io/podman/v6/cmd/podman/containers can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/cmd/podman/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/containers uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/cmd/podman/containers, while a change to io/podman/v6/cmd/podman/containers can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/cmd/podman/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/containers uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/containers, while a change to io/podman/v6/cmd/podman/containers can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/containers uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in io/podman/v6/cmd/podman/containers uses a type in io/podman/v6/pkg/domain/entities. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/cmd/podman/containers uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/containers, while a change to io/podman/v6/cmd/podman/containers can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/containers uses io/podman/v6/cmd/podman/common, so a change to io/podman/v6/cmd/podman/common can break io/podman/v6/cmd/podman/containers, while a change to io/podman/v6/cmd/podman/containers can't break io/podman/v6/cmd/podman/common.
Position
Below the diagonal: io/podman/v6/cmd/podman/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/images uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/cmd/podman/images, while a change to io/podman/v6/cmd/podman/images can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/cmd/podman/images uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/images uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/cmd/podman/images, while a change to io/podman/v6/cmd/podman/images can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/cmd/podman/images uses a module listed above it, which is the healthy direction.
io/podman/v6/cmd/podman/images uses io/podman/v6/cmd/podman/common, so a change to io/podman/v6/cmd/podman/common can break io/podman/v6/cmd/podman/images, while a change to io/podman/v6/cmd/podman/images can't break io/podman/v6/cmd/podman/common.
Position
Below the diagonal: io/podman/v6/cmd/podman/images uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/utils uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/api/handlers/utils, while a change to io/podman/v6/pkg/api/handlers/utils can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/utils uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/utils uses io/podman/v6/libpod/events, so a change to io/podman/v6/libpod/events can break io/podman/v6/pkg/api/handlers/utils, while a change to io/podman/v6/pkg/api/handlers/utils can't break io/podman/v6/libpod/events.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/utils uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/utils uses io/podman/v6/libpod, so a change to io/podman/v6/libpod can break io/podman/v6/pkg/api/handlers/utils, while a change to io/podman/v6/pkg/api/handlers/utils can't break io/podman/v6/libpod.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/utils uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/server uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/api/server, while a change to io/podman/v6/pkg/api/server can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/api/server uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/server uses io/podman/v6/libpod, so a change to io/podman/v6/libpod can break io/podman/v6/pkg/api/server, while a change to io/podman/v6/pkg/api/server can't break io/podman/v6/libpod.
Position
Below the diagonal: io/podman/v6/pkg/api/server uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/containers uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/bindings/containers, while a change to io/podman/v6/pkg/bindings/containers can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/bindings/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/containers uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/bindings/containers, while a change to io/podman/v6/pkg/bindings/containers can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/bindings/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/containers uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/pkg/bindings/containers, while a change to io/podman/v6/pkg/bindings/containers can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/pkg/bindings/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/containers uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/bindings/containers, while a change to io/podman/v6/pkg/bindings/containers can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/bindings/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/bindings/containers uses io/podman/v6/pkg/api/handlers, so a change to io/podman/v6/pkg/api/handlers can break io/podman/v6/pkg/bindings/containers, while a change to io/podman/v6/pkg/bindings/containers can't break io/podman/v6/pkg/api/handlers.
Position
Below the diagonal: io/podman/v6/pkg/bindings/containers uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/domain/infra, while a change to io/podman/v6/pkg/domain/infra can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra uses io/podman/v6/libpod, so a change to io/podman/v6/libpod can break io/podman/v6/pkg/domain/infra, while a change to io/podman/v6/pkg/domain/infra can't break io/podman/v6/libpod.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
73 pairs of types, where a type in io/podman/v6/pkg/domain/infra/abi uses a type in io/podman/v6/pkg/domain/entities/types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
146 pairs of types, where a type in io/podman/v6/pkg/domain/infra/abi uses a type in io/podman/v6/pkg/domain/entities. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/abi uses io/podman/v6/libpod, so a change to io/podman/v6/libpod can break io/podman/v6/pkg/domain/infra/abi, while a change to io/podman/v6/pkg/domain/infra/abi can't break io/podman/v6/libpod.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/abi uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/pkg/specgen, so a change to io/podman/v6/pkg/specgen can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/pkg/specgen.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
74 pairs of types, where a type in io/podman/v6/pkg/domain/infra/tunnel uses a type in io/podman/v6/pkg/domain/entities/types. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/pkg/domain/entities/types, so a change to io/podman/v6/pkg/domain/entities/types can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/pkg/domain/entities/types.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
134 pairs of types, where a type in io/podman/v6/pkg/domain/infra/tunnel uses a type in io/podman/v6/pkg/domain/entities. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/domain/infra/tunnel uses io/podman/v6/pkg/api/handlers, so a change to io/podman/v6/pkg/api/handlers can break io/podman/v6/pkg/domain/infra/tunnel, while a change to io/podman/v6/pkg/domain/infra/tunnel can't break io/podman/v6/pkg/api/handlers.
Position
Below the diagonal: io/podman/v6/pkg/domain/infra/tunnel uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/libpod/define, so a change to io/podman/v6/libpod/define can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/libpod/define.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/pkg/domain/entities/reports, so a change to io/podman/v6/pkg/domain/entities/reports can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/pkg/domain/entities/reports.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/pkg/domain/entities, so a change to io/podman/v6/pkg/domain/entities can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/pkg/domain/entities.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/libpod, so a change to io/podman/v6/libpod can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/libpod.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/pkg/api/handlers, so a change to io/podman/v6/pkg/api/handlers can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/pkg/api/handlers.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
io/podman/v6/pkg/api/handlers/compat uses io/podman/v6/pkg/domain/infra/abi, so a change to io/podman/v6/pkg/domain/infra/abi can break io/podman/v6/pkg/api/handlers/compat, while a change to io/podman/v6/pkg/api/handlers/compat can't break io/podman/v6/pkg/domain/infra/abi.
Position
Below the diagonal: io/podman/v6/pkg/api/handlers/compat uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 52% · Adequate · gated by D1, D2, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
76
High / Critical
A03:2025 — Software Supply Chain Failures
8
Medium
A07:2025 — Authentication Failures
7
High / Critical
A02:2025 — Security Misconfiguration
5
High / Critical
Roadmap
First, adopt a type checker to systematically eliminate nil risks by migrating files to strict mode and narrowing assertions. Next, refactor the most complex functions to reduce both cognitive and cyclomatic complexity, prioritizing the highest-rated bodies to improve overall maintainability. Then, enforce encapsulation by making entity setters private and exposing collections as read-only interfaces to protect invariants. Finally, ensure robust cancellation by threading context through all request-making functions so operations stop when their callers give up.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Bring the 198 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 233), ContainerEngine.playKubePod (cognitive 231).
Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with specgenutil.FillOutSpecGen (cyclomatic 199), Container.generateSpec (cyclomatic 157), ContainerEngine.playKubePod (cyclomatic 129).
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
Per-file score 0–10 — a quality signature. Of 397 files carrying findings, judged against the Production bar: 0% slop · 64% mixed · 36% near-clean.
File
Score
Band
Worst signal
REDACTED
3.9
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.1
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.2
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
4.6
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.9
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
5.3
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.8
Mixed
Secrets (history): High secret: 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 — 18
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 — 1535
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 — 122
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 70 of 74 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 74 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1661 of 1675 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.go, .py) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not included — the Go suite (go.podman.io/podman/v6) did not finish re-running within its budget: the Go suite did not finish re-running within its tier budget.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its Go module dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D31 IaC & Container Security — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Pkg/bindings/test/fixture/Containerfile, test/build/from-scratch/Dockerfile, test/e2e/build/Containerfile.with-platform, test/e2e/build/basicalpine/Containerfile, test/python/docker/build_labels/Dockerfile carries no `FROM` instruction, so it declares no build stage and every Dockerfile rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 41 of 46 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (vendor/github.com/containers/luksy/Dockerfile). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go, Python, c, lua is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go, Python, c, lua 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.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 44 further occurrence(s) are not listed individually; the score already reflects all 84.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
DM4 Rich vs anemic model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
The LLM boundary
LLM-set scores this run (4): D19, D20, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
304 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was specgenutil.FillOutSpecGen at 199. A further 2 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 events.StringToStatus at 43 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: libpod/stats_linux.go (Container.getPlatformContainerStats at 31). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 298 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with specgenutil.FillOutSpecGen (cyclomatic 199), Container.generateSpec (cyclomatic 157), ContainerEngine.playKubePod (cyclomatic 129). — 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 23 together lifts Cyclomatic Complexity from 2.0 to about 4.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 470 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 198 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 233), ContainerEngine.playKubePod (cognitive 231). — 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 198 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
308 duplicated block group(s) detected. A further 22 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 89 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 32 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with containers.go (5), boltdb_state.go (2), play.go (2). — One of this dimension's main actionable groups (32 warning-level).
Resolve the 27 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with containers.go (5), container_api.go (2), REDACTED (2). — One of this dimension's main actionable groups (27 warning-level).
Resolve the 27 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (6), REDACTED (3), volumes.go (2). — One of this dimension's main actionable groups (27 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with runtime.go (2), REDACTED, connection_stdio.go. — One of this dimension's main actionable groups (5 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
All 3 mechanizable ADR(s) are enforced: 2 by analyzers, 1 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
✓ On the Gold path — maintain.
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D9 · Test Distribution9.9 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
691 test methods: 688 unit, 0 integration, 0 BDD, 3 e2e. The Python suite contributes 136 test function(s) across 13 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 555 test case(s) across 150 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 7 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
1 outdated, 0 author-deprecated direct Go module(s), 1 pinning or checksum defect(s). 73 of 73 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.
Dependency pinned to a stale untagged commit: github.com/google/shlex
Outdated: github.com/kevinburke/ssh_config
What to do
Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 180 required Go module(s) use a banned license. Licences were read per module version from the licence files pkg.go.dev detects (via api.deps.dev), over every module this repository's REDACTED requires, direct and indirect, at the version the build uses. Go records no test-only scope at module level, so modules only this repository's own tests import are included. ★ COVERAGE OF THIS VERDICT: it grades this repository's Go module dependencies and nothing else. The repository also declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 40 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (3), play.go (2), containers.go (2). — One of this dimension's main actionable groups (40 warning-level).
Resolve the 1 Repeated repair finding(s) in Churn × Complexity Hotspots — start with container_inspect.go. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.8 / 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.
9 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/domain/utils/scp_compression.go. Counted over 502 of the 985 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
280 deducted task-comment markers across 166076 LoC (0.2/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.
Resolve the 227 TodoComment finding(s) in Explicit Debt — start with types.go (28), specgen.go (10), machine.go (8). — One of this dimension's main actionable groups (227 warning-level).
Resolve the 48 FixmeComment finding(s) in Explicit Debt — start with run_test.go (7), play.go (4), artifact_mount_test.go (3). — One of this dimension's main actionable groups (48 warning-level).
Resolve the 3 XxxComment finding(s) in Explicit Debt — start with quadlet.go (3). — One of this dimension's main actionable groups (3 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README is a clear overview of Podman as a tool for managing OCI containers and pods, with release cadence, licensing, and links to the LFX health score. It also documents the completions/README (shell completion scripts), docs/README (Podman documentation build structure, manpage syntax, API reference, local testing), test/README (destructive system tests, quick reference table, running specific tests with focus flags), cmd/podman/README (example of adding a new primary command and sub-command to the CLI), contrib/dependencies/README (dependency analysis, goda installation, bloat check diff), contrib/design-docs/README (design documents for future features), and contrib/systemd/README (systemd socket activation setup). The docs/README is also an excellent architecture document covering directory structure, support files, manpage syntax, API reference, local testing, and test utils. All the outlined sections exist in the visible text. The repository's READMEs document each directory (e.g., podman bindings, kubernetes copies, test/apiv2, buildah-bud, certs, compose, system, upgrade) rather than the root project. The package-level documentation is comprehensive: a Podman Golang bindings README covers installation, service-starting commands, connection creation, and examples; a Docker-compose v2 tests README explains how to run tests, the test runner syntax, curl-based assertions with expected string results, and debugging tips; a podman-in-podman upgrade test README gives background, an available-old-podman list, invocation, and notes about running the script. The architecture/design docs are also present (452 markdown files).
What to do
Improve Documentation Quality — currently 8.6/10. — The repository's root README is a clear overview of Podman as a tool for managing OCI containers and pods, with release cadence, licensing, and links to the LFX health score. It also documents the completions/README (shell completion scripts), docs/README (Podman documentation build structure, manpage syntax, API reference, local testing), test/README (destructive system tests, quick reference table, running specific tests with focus flags), cmd/podman/README (example of adding a new primary command and sub-command to the CLI), contrib/dependencies/README (dependency analysis, goda installation, bloat check diff), contrib/design-docs/README (design documents for future features), and contrib/systemd/README (systemd socket activation setup). The docs/README is also an excellent architecture document covering directory structure, support files, manpage syntax, API reference, local testing, and test utils. All the outlined sections exist in the visible text. The repository's READMEs document each directory (e.g., podman bindings, kubernetes copies, test/apiv2, buildah-bud, certs, compose, system, upgrade) rather than the root project. The package-level documentation is comprehensive: a Podman Golang bindings README covers installation, service-starting commands, connection creation, and examples; a Docker-compose v2 tests README explains how to run tests, the test runner syntax, curl-based assertions with expected string results, and debugging tips; a podman-in-podman upgrade test README gives background, an available-old-podman list, invocation, and notes about running the script. The architecture/design docs are also present (452 markdown files).
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR QualityStrong◐ Sampled · advisory
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
Evaluated 5 ADR(s) individually; mean quality 7.8/10 (mixed — many ADRs miss context or consequences). 0 flagged with a specific gap.
What to do
Improve ADR Quality — currently 7.8/10. — Evaluated 5 ADR(s) individually; mean quality 7.8/10 (mixed — many ADRs miss context or consequences). 0 flagged with a specific gap.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 of 2 build units (Go, Python) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
12 finding(s): 0 critical, 12 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
76 finding(s): 0 critical, 10 high, 30 medium, 36 low. semgrep hit a parse error in 3 file(s) — `docs/remote-docs.sh` (line 25, line 26, line 27, …), `hack/podman-registry` (line 145, line 161), `REDACTED` (line 150, line 151, line 187, …) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
41 of 502 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/api/server/register_pods.go. Counted over 502 of the 985 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 4 Change coupling finding(s) in Change Coupling — start with config.go (2), types.go, vfkit.go. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule), on a type that also offers no static Create/Of/From/New factory. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
Do you agree with this assessment?
DM12 · Ambient inputs in the domain10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether domain types receive the time and randomness their rules depend on, rather than reading the process clock or a global random source directly — an ambient read makes the rule it feeds untestable at the instant that matters and lets two reads inside one operation disagree.
Method: Roslyn (DDD-gated, C#/VB only): domain-layer types scanned for ambient reads — DateTime/DateTimeOffset.Now/UtcNow/Today, Random.Shared, new Random(), Stopwatch.GetTimestamp — resolved against the semantic model, with a comment/string-stripped token fallback only where resolution fails. Body reads are scored; field/property initialisers are surfaced unscored. Apply/When folds excluded (ES1 owns them). Deterministic, symbol-resolved.
Other · Domain Modelling — How much of the domain uses strongly-typed ids vs raw Guid/string/int — adoption curve, not all-or-nothing.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`PruneReport.Id` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that. — pkg/domain/entities/reports/prune.go:10
What to do
Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
Do you agree with this assessment?
DM4 · Rich vs anemic model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether aggregates/entities carry the behaviour that protects their invariants, rather than being data bags driven by external services.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
`PruneReport` exposes publicly writable state (Id, Err, Size). — pkg/domain/entities/reports/prune.go:9
What to do
Make entity setters private/init-only and hand collections out as IReadOnlyList/IReadOnlyCollection over a private backing field; change state only through methods that enforce the invariants (Marten/EF can bind via constructor or private setters).
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) — the clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Other · Domain Modelling — Whether repositories are per aggregate root (not per child entity) and keep the persistence query handle behind the contract, so the root's invariants can't be bypassed.
Method: Roslyn (DDD-gated): repository abstraction detection; repositories over non-aggregate-root entities flagged, and (C#/VB) repository INTERFACES whose members return a live persistence query handle (IQueryable/DbSet/IMongoQueryable) — implementations and specification evaluators are out of population by design, since composing a query internally is what an implementation is for. Deterministic, DDD-native.
Coverage: Population: repositories + aggregate roots by NAME convention; per-root repository rule checked within the set.
Other · Domain Modelling — Whether clusters of primitives that travel together (a missing value object) are extracted — a low-weight suggestion, LLM-confirmed when configured.
Method: Roslyn (DDD-gated): primitive parameter clusters recurring three or more times across signatures extracted, then confirmed by language model when configured. Advisory, low-weight.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
test/README.md documents the environment variable `PODMAN_DB`, but no code, script or configuration file names it. 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. — test/README.md:133
What to do
Reconcile the README with reality: test/README.md documents the environment variable `PODMAN_DB`, but no code, script or configuration file names it.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
What to do
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — cmd/podman/kube/play.go:441, pkg/machine/stdpull/url.go:93
`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. (×2) — pkg/machine/apple/vfkit/helper.go:27, pkg/machine/apple/vfkit/helper.go:36
What to do
Give every `http.Client` an explicit `Timeout` (never call `http.Get`/`http.Post` or `http.DefaultClient`, which have none), or build each request with `http.NewRequestWithContext` under a `context.WithTimeout`; add retry with back-off (`hashicorp/go-retryablehttp`) and a breaker (`sony/gobreaker`) around dependencies that fail.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 322 use(s) across 187,318 production line(s) (~1.7/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 5/18 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.
`readerFromArg` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — cmd/podman/kube/play.go:438
`validatePlugin` 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, …)`. — libpod/plugin/volume_api.go:76
`sendRequest` 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, …)`. — libpod/plugin/volume_api.go:200
`createObject` 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, …)`. — REDACTED:151
`dialSocket` calls `dialer.DialContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/config.go:158
`get` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/apple/vfkit/helper.go:26
`post` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/apple/vfkit/helper.go:35
`checkSockInUse` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/shim/networking_unix.go:113
`isListening` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/shim/networking.go:268
`claimDockerSock` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/shim/claim_darwin.go:29
`DialSocketWithBackoffs` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/sockets/sockets.go:38
`DialSocketWithBackoffsAndProcCheck` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/sockets/sockets.go:55
`pull` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — pkg/machine/stdpull/url.go:82
What to do
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether 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 walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`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. (×26) — cmd/podman/common/completion.go:446, cmd/podman/common/completion.go:1735, cmd/podman/machine/machine.go:119, …
`if err = scanner.Err(); 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. — cmd/podman/common/completion.go:1296
`if err := fileutils.Exists(sqliteStatePath(runtime)); 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. — libpod/sqlite_state_internal.go:38
`if err := fileutils.Exists(filepath.Join(path, " ")); 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. — libpod/runtime.go:1361
`if err := JSONDeepCopy(p.config.ResourceLimits, resCopy); 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. — libpod/pod.go:143
`if createNetNSErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — libpod/container_internal_linux.go:90, libpod/container_internal_linux.go:95, libpod/container_internal_freebsd.go:54, …
`if mountStorageErr != 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) — libpod/container_internal_linux.go:112, libpod/container_internal_freebsd.go:75
`if err := c.syncContainer(); 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) — libpod/container_api.go:1118, libpod/container_api.go:1131
`if err := JSONDeepCopy(c.config, returnConfig); 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. — libpod/container.go:334
`if err := JSONDeepCopy(c.config.Spec, returnSpec); 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. — libpod/container.go:378
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 51 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AC7 A11y enforcement — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface 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 — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; 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 — ~85771 lines of test source are present (.go, .py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included
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.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (pkg), 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — none of 5 ADRs are conformance-checkable — unverifiable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.go), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D3 God Classes — Most of this repository's production source (.c, .go) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D5 Coupling — Not applicable — this Go build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM10 One transaction, one aggregate — no repository writes detected — no operation to judge against the one-aggregate rule
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 CQRS handler(s); 2 event-sourced shape(s) (event folds / event-recording aggregates)
ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (2 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 and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
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.
X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
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.
TodoComment cmd/podman/artifact/push.go:92— // TODO I think these two can be removed? — 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 cmd/podman/artifact/push.go:187— // TODO If not compression options are supported, we do not need the following — 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 cmd/podman/artifact/inspect.go:44— // TODO When the inspect structure has been defined, we need to uncomment and redirect this. Reminder, this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cmd/podman/common/create.go:433— // TODO: add timezone completion — 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 cmd/podman/common/create.go:956— // TODO (7.0): remove the cpu-rt-period flag, it requires cgroups v1 — 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 cmd/podman/common/create.go:967— // TODO (7.0): remove the cpu-rt-runtime flag, it requires cgroups v1 — 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 cmd/podman/common/completion.go:1306— // TODO: Add support for all different options — 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 cmd/podman/common/build.go:315— // TODO: this code should really be in Buildah. — 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 cmd/podman/containers/create.go:135— // TODO: v5.0 block users from setting restart policy for a container if the container is in a pod — 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 REDACTED:106— // TODO when save is merged, we need to process reference — 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 cmd/podman/machine/stop.go:32— // TODO Name shouldn't be required, need to create a default vm — 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 cmd/podman/machine/server9p.go:58— // TODO: need to support options here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cmd/podman/machine/machine.go:76— // TODO: offer virtual machine path completion — 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 cmd/podman/machine/init.go:275— // TODO need to work this back in — 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 hack/branch_commits.rb:74— # TODO: This could probably be made a whole lot more efficient by unifying the — 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 libpod/volume_internal_common.go:103— // TODO: might want to cache this path in the runtime? — 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 libpod/stats_freebsd.go:39— //nolint:wastedassign // TODO: figure this 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.
TodoComment libpod/sqlite_state_internal.go:303— // TODO: There is a potential risk of concurrent map modification here. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libpod/sqlite_state_internal.go:434— // TODO: There has to be a better way of doing this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libpod/sqlite_state.go:2042— // TODO: There has to be a better way of doing this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libpod/sqlite_state.go:350— // TODO: The transaction isn't strictly necessary, and there's a (small) — 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 libpod/sqlite_state.go:393— // TODO: We can't remove this code without breaking existing SQLite DBs — 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 libpod/sqlite_state.go:1694— // TODO: explore whether there's a more idiomatic way to do error checks for the name. — 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 libpod/runtime_volume_common.go:165— // TODO: reevaluate this once we actually have volume plugins in — 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 libpod/runtime_volume_common.go:346— // TODO: What do we do if we get a 200 response, but the — 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 cmd/podman/compose.go:166— // FIXME: DOCKER_CONFIG is limited by containers/podman/issues/18617 — 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 cmd/podman/kube/play.go:364— // FIXME: The cleanup logic below must be fixed to only remove — 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 REDACTED:948— // FIXME: this error should probably be returned — 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 pkg/machine/qemu/machine.go:201— // FIXME: this error should probably be returned — 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 REDACTED:1457— // FIXME: will this break something? — 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 pkg/api/handlers/compat/networks.go:389— // FIXME can we use the IPAM driver and options? — 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 pkg/api/handlers/compat/info.go:60— // FIXME: Need to expose if runtime supports Checkpointing — 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 pkg/api/handlers/compat/events.go:26— // FIXME: this should happen on the package level — 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 pkg/api/handlers/libpod/manifests.go:565— // FIXME: knowing that this is the location of the — 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 pkg/api/handlers/utils/handler.go:170— // FIXME: we don't need to write the header in all/some circumstances. — 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 pkg/bindings/containers/commit.go:59— // FIXME(vrothberg): it seems we always hit the EOF case below, — 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 REDACTED:922— // FIXME(vrothberg): it seems we always hit the EOF case below, — 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 REDACTED:590— // FIXME: This is one giant race condition. Let's hope no-one uses this same client until we're done! — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment pkg/domain/entities/types/generate.go:13— // FIXME: Podman4.0 should change io.Reader to io.ReaderCloser — 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 pkg/domain/infra/abi/play.go:307— // FIXME: both, the service container and the proxies, should ideally — 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 pkg/domain/infra/abi/play.go:799— // FIXME: how to deal with explicit mappings? — 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 pkg/domain/infra/abi/play.go:813— // FIXME This is very hard to support properly with a good ux — 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 pkg/domain/infra/abi/manifest.go:134— // FIXME should we use multierror package 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 pkg/domain/infra/tunnel/helpers.go:15— // FIXME: the `ignore` parameter is very likely wrong here as it should rather — 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 pkg/machine/e2e/config_init_test.go:106— // FIXME:#24344 work-around for custom ignition removal
FixmeComment pkg/specgen/generate/kube/kube.go:380— // FIXME, — 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 pkg/systemd/quadlet/quadlet.go:18— // Fixme should use — 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/apiv2/python/rest_api/test_v2_0_0_image.py:199— # FIXME: Research if quay.io supports is-official and which image is "official" — 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/apiv2/python/rest_api/test_v2_0_0_container.py:272— # FIXME need method to determine which image is going to be "pruned" to fix test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment test/apiv2/python/rest_api/test_v2_0_0_container.py:276— # FIXME (@vrothberg): I commented this line out during the `libimage` migration. — 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.
Hotspot: REDACTED REDACTED:235— REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in Container.generateSpec at line 235. 6 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02: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: pkg/specgenutil/specgen.go pkg/specgenutil/specgen.go:334— pkg/specgenutil/specgen.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 199 in specgenutil.FillOutSpecGen at line 334. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/specgenutil/specgen.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: pkg/domain/infra/abi/play.go pkg/domain/infra/abi/play.go:730— pkg/domain/infra/abi/play.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 129 in ContainerEngine.playKubePod at line 730. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/domain/infra/abi/play.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: pkg/specgen/generate/kube/kube.go pkg/specgen/generate/kube/kube.go:209— pkg/specgen/generate/kube/kube.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in kube.ToSpecGen at line 209. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/specgen/generate/kube/kube.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: pkg/api/handlers/compat/containers_create.go pkg/api/handlers/compat/containers_create.go:214— pkg/api/handlers/compat/containers_create.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in compat.cliOpts at line 214. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/api/handlers/compat/containers_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: libpod/runtime.go libpod/runtime.go:330— libpod/runtime.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in libpod.makeRuntime at line 330. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/runtime.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: pkg/systemd/quadlet/quadlet.go pkg/systemd/quadlet/quadlet.go:605— pkg/systemd/quadlet/quadlet.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in quadlet.ConvertContainer at line 605. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/systemd/quadlet/quadlet.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: libpod/container_internal.go libpod/container_internal.go:1749— libpod/container_internal.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in Container.mountStorage at line 1749. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/container_internal.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: pkg/machine/shim/host.go pkg/machine/shim/host.go:558— pkg/machine/shim/host.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in shim.startLocked at line 558. 1 of those changes was a fix/bug commit, 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-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/machine/shim/host.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: pkg/specgen/generate/container.go pkg/specgen/generate/container.go:143— pkg/specgen/generate/container.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in generate.CompleteSpec at line 143. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/specgen/generate/container.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: pkg/domain/utils/scp.go pkg/domain/utils/scp.go:21— pkg/domain/utils/scp.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in utils.ExecuteTransfer at line 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/domain/utils/scp.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/podman/common/build.go cmd/podman/common/build.go:147— cmd/podman/common/build.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in common.ParseBuildOpts at line 147. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- cmd/podman/common/build.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/podman/kube/play.go cmd/podman/kube/play.go:234— cmd/podman/kube/play.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in kube.play at line 234. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- cmd/podman/kube/play.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: pkg/specgen/generate/container_create.go pkg/specgen/generate/container_create.go:33— pkg/specgen/generate/container_create.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in generate.MakeContainer at line 33. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/specgen/generate/container_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: pkg/domain/filters/containers.go pkg/domain/filters/containers.go:51— pkg/domain/filters/containers.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in filters.GenerateContainerFilterFuncs at line 51. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/domain/filters/containers.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/podman/root.go cmd/podman/root.go:270— cmd/podman/root.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in main.persistentPreRunE at line 270. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- cmd/podman/root.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/quadlet/main.go cmd/quadlet/main.go:527— cmd/quadlet/main.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in main.process at line 527. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- cmd/quadlet/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: REDACTED REDACTED:40— REDACTED changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in containers.Attach at line 40. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02: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: pkg/api/handlers/compat/containers.go pkg/api/handlers/compat/containers.go:785— pkg/api/handlers/compat/containers.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in compat.UpdateContainer at line 785. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/api/handlers/compat/containers.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/podman/containers/run.go cmd/podman/containers/run.go:105— cmd/podman/containers/run.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in containers.run at line 105. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- cmd/podman/containers/run.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: pkg/bindings/manifests/manifests.go pkg/bindings/manifests/manifests.go:316— pkg/bindings/manifests/manifests.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in manifests.Modify at line 316. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- pkg/bindings/manifests/manifests.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: libpod/networking_common.go libpod/networking_common.go:529— libpod/networking_common.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Container.NetworkConnect at line 529. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/networking_common.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:113— REDACTED changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in EventLogFile.Read at line 113. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02: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: libpod/runtime_volume_common.go libpod/runtime_volume_common.go:48— libpod/runtime_volume_common.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in Runtime.newVolume at line 48. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/runtime_volume_common.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: libpod/container_copy_common.go libpod/container_copy_common.go:27— libpod/container_copy_common.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in Container.copyFromArchive at line 27. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/container_copy_common.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.
Swallowed exception (caught, then discarded) cmd/podman/common/completion.go:446— `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) cmd/podman/common/completion.go:1296— `if err = scanner.Err(); 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) cmd/podman/common/completion.go:1735— `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) cmd/podman/machine/machine.go:119— `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) cmd/podman/machine/machine.go:123— `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) cmd/podman/machine/list.go:143— `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) cmd/podman/utils/utils.go:19— `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) cmd/quadlet/main.go:55— `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:290— `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) libpod/stats_linux.go:80— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) libpod/sqlite_state_internal.go:38— `if err := fileutils.Exists(sqliteStatePath(runtime)); 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) libpod/runtime.go:1213— `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) libpod/runtime.go:1361— `if err := fileutils.Exists(filepath.Join(path, " ")); 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) libpod/pod.go:143— `if err := JSONDeepCopy(p.config.ResourceLimits, resCopy); 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) libpod/pod.go:245— `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) libpod/pod.go:254— `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) libpod/pod.go:278— `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:601— `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:606— `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:611— `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) libpod/networking_linux.go:253— `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) libpod/info.go:327— `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) libpod/container_path_resolution.go:199— `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) libpod/container_internal_linux.go:90— `if createNetNSErr != 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) libpod/container_internal_linux.go:95— `if createNetNSErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Duplicated block (10 lines × 2) cmd/podman/artifact/pull.go:103— cmd/podman/artifact/pull.go:103-112 | cmd/podman/images/pull.go:168-177 — `cmd/podman/artifact/pull.go` and `cmd/podman/images/pull.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/artifact/pull.go:103` it does not close everything it opens, so those exact lines 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/podman/containers/pause.go:62— cmd/podman/containers/pause.go:62-71 | cmd/podman/containers/unpause.go:60-69 — before extracting anything, compare `cmd/podman/containers/pause.go` and `cmd/podman/containers/unpause.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/pause.go:62` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) REDACTED:116— REDACTED:116-125 | REDACTED:94-103 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (10 lines × 2) libpod/boltdb_state.go:216— libpod/boltdb_state.go:216-225 | libpod/boltdb_state.go:254-263 — both copies are in the same file, so extract the 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) REDACTED:744— REDACTED:744-753 | REDACTED:786-795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:744` it does not close everything it opens, so those exact lines 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) libpod/pod.go:462— libpod/pod.go:462-471 | libpod/pod_api.go:596-605 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (10 lines × 2) pkg/api/handlers/compat/containers.go:211— pkg/api/handlers/compat/containers.go:211-220 | pkg/api/handlers/libpod/containers.go:129-138 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) pkg/api/handlers/compat/distribution.go:36— pkg/api/handlers/compat/distribution.go:36-45 | pkg/api/handlers/libpod/images_push.go:67-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/distribution.go:36` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) pkg/api/handlers/compat/exec.go:153— pkg/api/handlers/compat/exec.go:153-164 | pkg/api/handlers/compat/exec.go:286-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. 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) pkg/api/handlers/libpod/artifacts.go:105— pkg/api/handlers/libpod/artifacts.go:105-114 | pkg/api/handlers/libpod/artifacts.go:361-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) REDACTED:116— REDACTED:116-125 | REDACTED:477-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 2) pkg/domain/filters/containers.go:82— pkg/domain/filters/containers.go:82-91 | pkg/domain/filters/containers.go:479-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:82` it begins part-way through the construct above it, so those exact lines 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) pkg/domain/infra/abi/play.go:442— pkg/domain/infra/abi/play.go:442-451 | pkg/domain/infra/abi/play.go:457-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/play.go:442` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) pkg/domain/infra/abi/play.go:1137— pkg/domain/infra/abi/play.go:1137-1146 | pkg/domain/infra/abi/play.go:1259-1268 — both copies are in the same file, so extract the 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, `pkg/domain/infra/abi/play.go:1270` calls `AddContainer` and `pkg/domain/infra/abi/play.go:1148` 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) pkg/domain/infra/runtime_libpod.go:285— pkg/domain/infra/runtime_libpod.go:285-294 | REDACTED:1037-1046 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/domain/infra/runtime_libpod.go:285` 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 (10 lines × 2) pkg/domain/infra/tunnel/containers.go:93— pkg/domain/infra/tunnel/containers.go:93-102 | pkg/domain/infra/tunnel/containers.go:118-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 `pkg/domain/infra/tunnel/containers.go:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) pkg/domain/utils/scp.go:122— pkg/domain/utils/scp.go:122-131 | pkg/domain/utils/scp.go:173-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) pkg/machine/env/dir.go:18— pkg/machine/env/dir.go:18-27 | pkg/machine/env/dir.go:112-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/machine/env/dir.go:18` 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) pkg/machine/os/machine_os.go:33— pkg/machine/os/machine_os.go:33-42 | pkg/machine/os/machine_os.go:61-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/machine/os/machine_os.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) pkg/machine/provider/platform.go:13— pkg/machine/provider/platform.go:13-23 | pkg/machine/shim/host.go:400-409 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/machine/provider/platform.go:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) REDACTED:410— REDACTED:410-419 | REDACTED:861-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:410` it begins part-way through the construct above it, so those exact lines 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) libpod/container_internal_freebsd.go:165— libpod/container_internal_freebsd.go:165-174 | libpod/container_internal_linux.go:212-221 — before extracting anything, compare `libpod/container_internal_freebsd.go` and `libpod/container_internal_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) pkg/domain/entities/reports/containers.go:9— pkg/domain/entities/reports/containers.go:9-18 | pkg/domain/entities/reports/prune.go:48-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 (10 lines × 2) pkg/domain/entities/reports/containers.go:20— pkg/domain/entities/reports/containers.go:20-29 | pkg/domain/entities/reports/prune.go:59-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) pkg/pidhandle/pidhandle.go:117— pkg/pidhandle/pidhandle.go:117-126 | pkg/pidhandle/pidhandle_linux.go:188-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) cmd/podman/artifact/push.go:55— cmd/podman/artifact/push.go:55-65 | cmd/podman/images/push.go:80-90 — `cmd/podman/artifact/push.go` and `cmd/podman/images/push.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 71 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `cmd/podman/images/push.go:92` calls `BoolVar` and `cmd/podman/artifact/push.go:70` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) cmd/podman/containers/cp.go:169— cmd/podman/containers/cp.go:169-179 | cmd/podman/containers/cp.go:324-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) libpod/container_api.go:634— libpod/container_api.go:634-644 | libpod/container_api.go:681-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) libpod/networking_freebsd.go:58— libpod/networking_freebsd.go:58-68 | libpod/networking_linux.go:22-32 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) libpod/pod_api.go:90— libpod/pod_api.go:90-100 | libpod/pod_api.go:459-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/pod_api.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. 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) libpod/runtime_ctr.go:397— libpod/runtime_ctr.go:397-407 | libpod/runtime_ctr.go:422-432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) pkg/api/handlers/compat/containers_top.go:35— pkg/api/handlers/compat/containers_top.go:35-45 | pkg/api/handlers/libpod/pods.go:398-408 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) pkg/api/handlers/compat/images.go:90— pkg/api/handlers/compat/images.go:90-100 | pkg/api/handlers/compat/images.go:621-631 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images.go:90` 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 (11 lines × 2) pkg/api/handlers/compat/images.go:197— pkg/api/handlers/compat/images.go:197-207 | pkg/api/handlers/compat/images.go:538-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/api/handlers/compat/images.go:208` calls `Name` and `pkg/api/handlers/compat/images.go:549` 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) pkg/api/handlers/compat/images_build.go:1011— pkg/api/handlers/compat/images_build.go:1011-1021 | pkg/api/handlers/compat/images_build.go:1190-1200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images_build.go:1011` 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) pkg/bindings/containers/rename.go:12— pkg/bindings/containers/rename.go:12-22 | pkg/bindings/volumes/rename.go:12-22 — `pkg/bindings/containers/rename.go` and `pkg/bindings/volumes/rename.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 22 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) pkg/domain/filters/containers.go:143— pkg/domain/filters/containers.go:143-153 | pkg/domain/filters/containers.go:157-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:143` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) pkg/domain/infra/tunnel/containers.go:46— pkg/domain/infra/tunnel/containers.go:46-56 | pkg/domain/infra/tunnel/containers.go:76-86 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) pkg/machine/ocipull/ociartifact.go:316— pkg/machine/ocipull/ociartifact.go:316-326 | pkg/machine/ocipull/source.go:91-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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) pkg/specgen/generate/config_freebsd.go:21— pkg/specgen/generate/config_freebsd.go:21-31 | pkg/specgen/generate/config_linux.go:28-38 — before extracting anything, compare `pkg/specgen/generate/config_freebsd.go` and `pkg/specgen/generate/config_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/config_freebsd.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 (11 lines × 2) pkg/specgen/namespaces.go:506— pkg/specgen/namespaces.go:506-516 | pkg/specgen/namespaces.go:519-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) pkg/systemd/generate/containers.go:530— pkg/systemd/generate/containers.go:530-540 | pkg/systemd/generate/pods.go:415-425 — 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 `pkg/systemd/generate/containers.go:530` 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) libpod/container_copy_common.go:353— libpod/container_copy_common.go:353-363 | REDACTED:1131-1141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) libpod/sqlite_state.go:1445— libpod/sqlite_state.go:1445-1455 | libpod/sqlite_state.go:2253-2265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1445` it does not close everything it opens, so those exact lines 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) libpod/networking_common.go:450— libpod/networking_common.go:450-461 | libpod/networking_common.go:595-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/networking_common.go:450` it begins part-way through the construct above it, so those exact lines 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/podman/utils/utils.go:36— cmd/podman/utils/utils.go:36-46 | cmd/podman/utils/utils.go:65-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) cmd/podman/containers/prune.go:53— cmd/podman/containers/prune.go:53-63 | cmd/podman/networks/prune.go:56-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/prune.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. 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) pkg/domain/infra/abi/containers.go:263— pkg/domain/infra/abi/containers.go:263-273 | pkg/domain/infra/abi/containers.go:284-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/containers.go:263` 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) libpod/runtime_pod_common.go:43— libpod/runtime_pod_common.go:43-53 | libpod/runtime_volume_common.go:235-245 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (11 lines × 2) libpod/container_api.go:457— libpod/container_api.go:457-467 | libpod/container_api.go:964-974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_api.go:457` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8 lines × 2) REDACTED:345— REDACTED:345-352 | REDACTED:505-512 — both copies are in the same file, so extract the 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) REDACTED:1499— REDACTED:1499-1506 | REDACTED:1953-1960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (8 lines × 2) REDACTED:219— REDACTED:219-226 | REDACTED:238-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) pkg/api/handlers/compat/containers_restart.go:29— pkg/api/handlers/compat/containers_restart.go:29-36 | pkg/api/handlers/compat/containers_stop.go:30-37 — before extracting anything, compare `pkg/api/handlers/compat/containers_restart.go` and `pkg/api/handlers/compat/containers_stop.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers_restart.go:29` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 2) pkg/api/handlers/compat/images.go:65— pkg/api/handlers/compat/images.go:65-72 | pkg/api/handlers/compat/images_remove.go:35-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/api/handlers/compat/images.go:63` calls `Remove`, `Name` and `pkg/api/handlers/compat/images_remove.go:34` 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) pkg/api/handlers/compat/images.go:118— pkg/api/handlers/compat/images.go:118-125 | pkg/api/handlers/libpod/images.go:508-515 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/images.go:118` 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) pkg/api/handlers/compat/images.go:551— pkg/api/handlers/compat/images.go:551-558 | pkg/api/handlers/libpod/images.go:366-373 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/images.go:551` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) pkg/api/handlers/compat/images_history.go:16— pkg/api/handlers/compat/images_history.go:16-23 | pkg/api/handlers/compat/images_tag.go:17-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) pkg/api/handlers/compat/system.go:24— pkg/api/handlers/compat/system.go:24-31 | pkg/api/handlers/libpod/system.go:63-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. 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) pkg/api/handlers/compat/volumes.go:100— pkg/api/handlers/compat/volumes.go:100-107 | pkg/api/handlers/libpod/volumes.go:30-38 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/volumes.go:100` it begins part-way through the construct above it, so those 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) pkg/api/handlers/libpod/images.go:713— pkg/api/handlers/libpod/images.go:713-720 | pkg/api/handlers/REDACTED:238-245 — 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 `pkg/api/handlers/libpod/images.go:713` it begins part-way through the construct above it, so those 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) pkg/api/handlers/libpod/networks.go:151— pkg/api/handlers/libpod/networks.go:151-158 | pkg/api/handlers/libpod/networks.go:207-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/networks.go:151` it begins part-way through the construct above it, so those exact lines 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:199— REDACTED:199-206 | REDACTED:292-299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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: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. 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) pkg/bindings/images/images.go:220— pkg/bindings/images/images.go:220-227 | pkg/bindings/images/images.go:242-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) pkg/domain/filters/volumes.go:32— pkg/domain/filters/volumes.go:32-39 | pkg/domain/filters/volumes.go:98-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/volumes.go:32` it begins part-way through the construct above it, so those exact lines 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) pkg/domain/infra/abi/pods.go:334— pkg/domain/infra/abi/pods.go:334-341 | pkg/specgen/generate/pod_create.go:298-306 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/domain/infra/abi/pods.go:334` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) REDACTED:41— REDACTED:41-48 | REDACTED:103-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) cmd/podman/images/search.go:215— cmd/podman/images/search.go:215-222 | cmd/podman/system/df.go:164-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) cmd/podman/machine/inspect.go:122— cmd/podman/machine/inspect.go:122-129 | cmd/podman/utils/utils.go:153-160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) pkg/api/handlers/libpod/pods.go:310— pkg/api/handlers/libpod/pods.go:310-317 | pkg/api/handlers/libpod/volumes.go:137-144 — 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) pkg/bindings/artifacts/remove.go:13— pkg/bindings/artifacts/remove.go:13-21 | pkg/bindings/network/network.go:96-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) libpod/sqlite_state.go:811— libpod/sqlite_state.go:811-818 | libpod/sqlite_state.go:1192-1199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:811` it begins part-way through the construct above it, so those 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, `libpod/sqlite_state.go:820` calls `Commit`, `Errorf`, `ID` and `libpod/sqlite_state.go:1201` 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) libpod/sqlite_state.go:1337— libpod/sqlite_state.go:1337-1344 | libpod/sqlite_state.go:1410-1417 — both copies are in the same file, so extract the 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) pkg/systemd/generate/containers.go:519— pkg/systemd/generate/containers.go:519-526 | pkg/systemd/generate/pods.go:404-411 — 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) REDACTED:2973— REDACTED:2973-2980 | REDACTED:3019-3026 — both copies are in the same file, so extract the block into 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) cmd/podman/common/completion.go:159— cmd/podman/common/completion.go:159-167 | cmd/podman/common/completion.go:338-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/podman/common/completion.go:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) cmd/podman/networks/create.go:215— cmd/podman/networks/create.go:215-223 | cmd/podman/networks/create.go:237-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) libpod/container_internal.go:919— libpod/container_internal.go:919-927 | libpod/pod_api.go:107-115 — 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 `libpod/container_internal.go:919` it does not close everything it opens, so those exact lines 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) pkg/api/handlers/compat/containers.go:763— pkg/api/handlers/compat/containers.go:763-771 | pkg/api/handlers/libpod/containers.go:473-481 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/containers.go:763` it begins part-way through the construct above it, so those 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) pkg/api/handlers/compat/images_remove.go:26— pkg/api/handlers/compat/images_remove.go:26-34 | pkg/api/handlers/libpod/manifests.go:757-766 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/images_remove.go:26` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) pkg/api/handlers/compat/volumes.go:146— pkg/api/handlers/compat/volumes.go:146-154 | pkg/api/handlers/libpod/volumes.go:43-51 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/volumes.go:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) pkg/api/handlers/libpod/images_push.go:155— pkg/api/handlers/libpod/images_push.go:155-163 | pkg/api/handlers/libpod/manifests.go:468-476 — before extracting anything, compare `pkg/api/handlers/libpod/images_push.go` and `pkg/api/handlers/libpod/manifests.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images_push.go:155` it does not close everything it opens, so those exact lines 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) pkg/api/handlers/libpod/pods.go:144— pkg/api/handlers/libpod/pods.go:144-152 | pkg/api/handlers/libpod/pods.go:253-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/pods.go:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) REDACTED:151— REDACTED:151-159 | REDACTED:179-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 `REDACTED:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) pkg/domain/infra/tunnel/manifest.go:68— pkg/domain/infra/tunnel/manifest.go:68-76 | pkg/domain/infra/tunnel/manifest.go:106-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 `pkg/domain/infra/tunnel/manifest.go:68` it does not close everything it opens, so those exact lines 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) pkg/specgenutil/specgen.go:1088— pkg/specgenutil/specgen.go:1088-1096 | pkg/specgenutil/specgen.go:1136-1144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgenutil/specgen.go:1088` it does not close everything it opens, so those exact lines 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:381— REDACTED:381-389 | REDACTED:834-842 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:381` it does not close everything it opens, so those exact lines 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) libpod/util_freebsd.go:19— libpod/util_freebsd.go:19-27 | libpod/util_linux.go:153-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) pkg/domain/infra/tunnel/network.go:98— pkg/domain/infra/tunnel/network.go:98-106 | pkg/domain/infra/tunnel/volumes.go:89-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) REDACTED:878— REDACTED:878-886 | REDACTED:895-903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:878` it begins part-way through the construct above it, so those exact lines 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) libpod/sqlite_state.go:1184— libpod/sqlite_state.go:1184-1192 | libpod/sqlite_state.go:1578-1586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1184` it does not close everything it opens, so those 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) pkg/api/handlers/compat/images.go:300— pkg/api/handlers/compat/images.go:300-308 | pkg/api/handlers/libpod/images_pull.go:118-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 `pkg/api/handlers/compat/images.go:300` it begins part-way through the construct above it, so those 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) pkg/bindings/artifacts/inspect.go:12— pkg/bindings/artifacts/inspect.go:12-20 | pkg/bindings/images/diff.go:17-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) libpod/sqlite_state.go:1317— libpod/sqlite_state.go:1317-1325 | libpod/sqlite_state.go:1373-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1317` it does not close everything it opens, so those 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) pkg/api/handlers/compat/images_push.go:44— pkg/api/handlers/compat/images_push.go:44-52 | pkg/api/handlers/compat/images_search.go:30-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 `pkg/api/handlers/compat/images_push.go:44` it begins part-way through the construct above it, so those 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 lines × 2) pkg/domain/filters/volumes.go:56— pkg/domain/filters/volumes.go:56-64 | pkg/domain/filters/volumes.go:113-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/volumes.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 (13 lines × 2) cmd/podman/containers/mount.go:105— cmd/podman/containers/mount.go:105-117 | cmd/podman/images/mount.go:79-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) cmd/podman/farm/list.go:74— cmd/podman/farm/list.go:74-86 | cmd/podman/system/connection/list.go:109-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/farm/list.go:74` 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) pkg/api/handlers/compat/images_push.go:106— pkg/api/handlers/compat/images_push.go:106-118 | pkg/api/handlers/libpod/manifests.go:316-328 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/compat/images_push.go:106` it does not close everything it opens, so those 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, `pkg/api/handlers/libpod/manifests.go:314` calls `GetName` and `pkg/api/handlers/compat/images_push.go:103` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) pkg/api/handlers/libpod/artifacts.go:109— pkg/api/handlers/libpod/artifacts.go:109-121 | pkg/api/handlers/libpod/images_pull.go:97-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) pkg/api/handlers/libpod/images.go:202— pkg/api/handlers/libpod/images.go:202-214 | pkg/api/handlers/libpod/images.go:289-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:202` it does not close everything it opens, so those exact lines 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) pkg/api/handlers/libpod/volumes.go:69— pkg/api/handlers/libpod/volumes.go:69-81 | pkg/domain/infra/abi/volumes.go:38-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/volumes.go:69` it begins part-way through the construct above it, so those exact lines 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:1260— REDACTED:1260-1272 | REDACTED:1278-1290 — both copies are in the same file, so extract the 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/domain/infra/abi/play.go:1079— pkg/domain/infra/abi/play.go:1079-1091 | pkg/domain/infra/abi/play.go:1169-1181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/play.go:1079` it does not close everything it opens, so those exact lines 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) pkg/domain/infra/abi/play.go:1116— pkg/domain/infra/abi/play.go:1116-1128 | pkg/domain/infra/abi/play.go:1213-1225 — both copies are in the same file, so extract the block into 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) REDACTED:129— REDACTED:129-141 | REDACTED:296-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.
Duplicated block (13 lines × 2) REDACTED:62— REDACTED:62-74 | REDACTED:97-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 (13 lines × 2) pkg/specgen/generate/security_linux.go:32— pkg/specgen/generate/security_linux.go:32-44 | pkg/specgen/generate/security_linux.go:46-58 — both copies are in the same file, so extract the block into 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) pkg/bindings/images/images.go:292— pkg/bindings/images/images.go:292-304 | pkg/bindings/images/pull.go:28-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/images/images.go:292` it does not close everything it opens, so those exact lines 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) libpod/sqlite_state.go:609— libpod/sqlite_state.go:609-621 | libpod/sqlite_state.go:1488-1500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:609` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) libpod/sqlite_state.go:1727— libpod/sqlite_state.go:1727-1739 | libpod/sqlite_state.go:1802-1814 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1727` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 2) pkg/domain/infra/abi/play.go:659— pkg/domain/infra/abi/play.go:659-671 | pkg/domain/infra/abi/play.go:707-719 — both copies are in the same file, so extract the block into 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/podman/containers/unmount.go:81— cmd/podman/containers/unmount.go:81-92 | cmd/podman/images/unmount.go:60-71 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/podman/containers/unmount.go:81` 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/podman/farm/build.go:90— cmd/podman/farm/build.go:90-101 | cmd/podman/images/build.go:83-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/podman/farm/build.go:90` it does not close everything it opens, so those 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 (12 lines × 2) cmd/podman/networks/list.go:136— cmd/podman/networks/list.go:136-147 | cmd/podman/secrets/list.go:117-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/podman/networks/list.go:136` 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) REDACTED:307— REDACTED:307-318 | REDACTED:386-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. 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) pkg/api/handlers/libpod/containers.go:277— pkg/api/handlers/libpod/containers.go:277-288 | pkg/api/handlers/libpod/containers.go:378-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. 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) pkg/api/handlers/libpod/pods.go:241— pkg/api/handlers/libpod/pods.go:241-252 | pkg/api/handlers/libpod/volumes.go:180-191 — 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 `pkg/api/handlers/libpod/pods.go:241` it does not close everything it opens, so those exact lines 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) pkg/api/handlers/libpod/pods.go:322— pkg/api/handlers/libpod/pods.go:322-333 | pkg/domain/infra/abi/pods.go:301-312 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/api/handlers/libpod/pods.go:322` 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) pkg/domain/filters/containers.go:206— pkg/domain/filters/containers.go:206-217 | pkg/domain/filters/containers.go:507-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 `pkg/domain/filters/containers.go:206` it begins part-way through the construct above it, so those exact lines 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) pkg/domain/infra/abi/pods.go:343— pkg/domain/infra/abi/pods.go:343-354 | pkg/specgen/generate/pod_create.go:308-319 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/domain/infra/abi/pods.go:343` it begins part-way through the construct above it, so those exact lines 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) pkg/specgen/generate/storage.go:77— pkg/specgen/generate/storage.go:77-88 | pkg/specgen/generate/storage.go:119-130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/storage.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.
Duplicated block (12 lines × 2) libpod/lock/file_lock_manager.go:40— libpod/lock/file_lock_manager.go:40-51 | libpod/lock/shm_lock_manager_linux.go:47-58 — 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) pkg/bindings/artifacts/pull.go:14— pkg/bindings/artifacts/pull.go:14-27 | pkg/bindings/images/pull.go:25-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) pkg/domain/infra/tunnel/pods.go:238— pkg/domain/infra/tunnel/pods.go:238-249 | pkg/domain/infra/tunnel/secrets.go:40-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/tunnel/pods.go:238` 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) libpod/sqlite_state.go:474— libpod/sqlite_state.go:474-485 | libpod/sqlite_state.go:499-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:474` it does not close everything it opens, so those exact lines 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) libpod/reset.go:211— libpod/reset.go:211-222 | libpod/reset.go:225-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/reset.go:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) cmd/podman/artifact/pull.go:118— cmd/podman/artifact/pull.go:118-133 | cmd/podman/images/pull.go:194-209 — `cmd/podman/artifact/pull.go` and `cmd/podman/images/pull.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/artifact/pull.go:118` it does not close everything it opens, so those exact lines 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) REDACTED:452— REDACTED:452-467 | REDACTED:597-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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: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 `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) libpod/container_graph.go:489— libpod/container_graph.go:489-504 | libpod/container_graph.go:564-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) libpod/sqlite_state.go:1560— libpod/sqlite_state.go:1560-1575 | libpod/sqlite_state.go:1601-1616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) pkg/api/handlers/compat/networks.go:260— pkg/api/handlers/compat/networks.go:260-275 | pkg/api/handlers/libpod/networks.go:84-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 (16 lines × 2) pkg/api/handlers/libpod/manifests.go:221— pkg/api/handlers/libpod/manifests.go:221-236 | pkg/api/handlers/libpod/manifests.go:638-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (16 lines × 2) REDACTED:189— REDACTED:189-204 | REDACTED:521-536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:189` it does not close everything it opens, so those exact lines 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) pkg/domain/infra/abi/manifest.go:254— pkg/domain/infra/abi/manifest.go:254-269 | pkg/domain/infra/tunnel/manifest.go:161-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. 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) pkg/domain/infra/abi/play.go:263— pkg/domain/infra/abi/play.go:263-278 | pkg/domain/infra/abi/play.go:1830-1845 — both copies are in the same file, so extract the 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 (16 lines × 2) pkg/specgen/generate/oci_freebsd.go:53— pkg/specgen/generate/oci_freebsd.go:53-68 | pkg/specgen/generate/oci_linux.go:308-323 — before extracting anything, compare `pkg/specgen/generate/oci_freebsd.go` and `pkg/specgen/generate/oci_linux.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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) pkg/specgen/generate/oci_freebsd.go:119— pkg/specgen/generate/oci_freebsd.go:119-134 | pkg/specgen/generate/oci_linux.go:278-293 — before extracting anything, compare `pkg/specgen/generate/oci_freebsd.go` and `pkg/specgen/generate/oci_linux.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/specgen/generate/oci_freebsd.go:117` calls `IsPrivileged` and `pkg/specgen/generate/oci_linux.go:276` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16 lines × 2) pkg/specgenutil/volumes.go:674— pkg/specgenutil/volumes.go:674-689 | pkg/specgenutil/volumes.go:728-743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgenutil/volumes.go:674` it does not close everything it opens, so those exact lines 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) pkg/systemd/generate/containers.go:288— pkg/systemd/generate/containers.go:288-303 | pkg/systemd/generate/pods.go:273-288 — 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 `pkg/systemd/generate/containers.go:288` it does not close everything it opens, so those exact lines 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) libpod/boltdb_state.go:474— libpod/boltdb_state.go:474-489 | libpod/boltdb_state.go:583-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/boltdb_state.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. 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) libpod/container.go:868— libpod/container.go:868-874 | libpod/container.go:880-886 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 2) REDACTED:2987— REDACTED:2987-2993 | REDACTED:3033-3039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:2987` it does not close everything it opens, so those 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 (7 lines × 2) pkg/api/handlers/compat/containers_stats.go:29— pkg/api/handlers/compat/containers_stats.go:29-35 | pkg/api/handlers/compat/events.go:35-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 `pkg/api/handlers/compat/containers_stats.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. 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 (7 lines × 2) pkg/api/handlers/compat/images.go:445— pkg/api/handlers/compat/images.go:445-453 | pkg/api/handlers/libpod/pods.go:484-490 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images.go:445` it begins part-way through the construct above it, so those 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 (7 lines × 2) pkg/api/handlers/libpod/containers.go:139— pkg/api/handlers/libpod/containers.go:139-145 | pkg/api/handlers/libpod/containers.go:181-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/api/handlers/libpod/containers.go:177` calls `WriteResponse`, `MountContainer` and `pkg/api/handlers/libpod/containers.go:138` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) pkg/domain/infra/tunnel/containers.go:593— pkg/domain/infra/tunnel/containers.go:593-599 | pkg/domain/infra/tunnel/containers.go:939-945 — both copies are in the same file, so extract the block into 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) REDACTED:424— REDACTED:424-430 | REDACTED:875-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) pkg/api/handlers/compat/images.go:56— pkg/api/handlers/compat/images.go:56-62 | pkg/api/handlers/libpod/images.go:352-358 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) pkg/machine/wsl/machine.go:555— pkg/machine/wsl/machine.go:555-561 | pkg/machine/wsl/machine.go:564-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) pkg/specgenutil/volumes.go:469— pkg/specgenutil/volumes.go:469-475 | pkg/specgenutil/volumes.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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgenutil/volumes.go:469` it begins part-way through the construct above it, so those 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) REDACTED:2965— REDACTED:2965-2971 | REDACTED:3011-3017 — both copies are in the same file, so extract the 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) pkg/api/handlers/libpod/containers.go:363— pkg/api/handlers/libpod/containers.go:363-369 | pkg/api/handlers/libpod/images.go:63-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/containers.go:363` it does not close everything it opens, so those exact lines 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) libpod/sqlite_state_internal.go:637— libpod/sqlite_state_internal.go:637-643 | libpod/sqlite_state_internal.go:656-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state_internal.go:637` it does not close everything it opens, so those 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.
X2 · Cancellation propagation· Function without context.Context · ×13
Function without context.Context: readerFromArg cmd/podman/kube/play.go:438— `readerFromArg` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: validatePlugin libpod/plugin/volume_api.go:76— `validatePlugin` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: sendRequest libpod/plugin/volume_api.go:200— `sendRequest` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: createObject REDACTED:151— `createObject` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: dialSocket pkg/machine/config.go:158— `dialSocket` calls `dialer.DialContext(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: get pkg/machine/apple/vfkit/helper.go:26— `get` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: post pkg/machine/apple/vfkit/helper.go:35— `post` calls `http.NewRequest(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: checkSockInUse pkg/machine/shim/networking_unix.go:113— `checkSockInUse` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: isListening pkg/machine/shim/networking.go:268— `isListening` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: claimDockerSock pkg/machine/shim/claim_darwin.go:29— `claimDockerSock` calls `net.DialTimeout(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: DialSocketWithBackoffs pkg/machine/sockets/sockets.go:38— `DialSocketWithBackoffs` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: DialSocketWithBackoffsAndProcCheck pkg/machine/sockets/sockets.go:55— `DialSocketWithBackoffsAndProcCheck` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: pull pkg/machine/stdpull/url.go:82— `pull` calls `http.Get(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Duplicated block (6 lines × 2) cmd/podman/artifact/push.go:80— cmd/podman/artifact/push.go:80-86 | cmd/podman/images/push.go:113-118 — `cmd/podman/artifact/push.go` and `cmd/podman/images/push.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 71 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `cmd/podman/images/push.go:111` calls `BoolVar` and `cmd/podman/artifact/push.go:78` 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) libpod/container_internal_linux.go:500— libpod/container_internal_linux.go:500-505 | libpod/options.go:867-872 — 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 `libpod/container_internal_linux.go:500` it does not close everything it opens, so those exact lines 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) pkg/api/handlers/compat/networks.go:558— pkg/api/handlers/compat/networks.go:558-563 | pkg/api/handlers/compat/volumes.go:282-287 — 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 (6 lines × 2) pkg/api/handlers/compat/secrets.go:23— pkg/api/handlers/compat/secrets.go:23-28 | pkg/api/handlers/libpod/volumes.go:120-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) pkg/api/handlers/libpod/containers.go:219— pkg/api/handlers/libpod/containers.go:219-224 | pkg/api/handlers/libpod/containers.go:305-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/containers.go:219` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) pkg/api/handlers/libpod/images.go:690— pkg/api/handlers/libpod/images.go:690-695 | pkg/api/handlers/libpod/manifests.go:758-766 — 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 `pkg/api/handlers/libpod/images.go:690` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) REDACTED:866— REDACTED:866-871 | libpod/oci_missing.go:217-222 — 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) pkg/domain/infra/abi/images.go:943— pkg/domain/infra/abi/images.go:943-948 | REDACTED:1156-1162 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/specgen/generate/storage.go:71— pkg/specgen/generate/storage.go:71-76 | pkg/specgen/generate/storage.go:113-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 `pkg/specgen/generate/storage.go:71` it begins part-way through the construct above it, so those 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:210— REDACTED:210-215 | pkg/domain/infra/tunnel/network.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 `REDACTED:210` it does not close everything it opens, so those exact lines 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) libpod/runtime_volume_common.go:174— libpod/runtime_volume_common.go:174-179 | libpod/runtime_volume_common.go:218-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) libpod/container_api.go:179— libpod/container_api.go:179-193 | libpod/container_internal.go:1263-1277 — 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 `libpod/container_api.go:179` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (15 lines × 2) libpod/networking_freebsd.go:69— libpod/networking_freebsd.go:69-83 | libpod/networking_linux.go:39-53 — 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 (15 lines × 2) libpod/service.go:146— libpod/service.go:146-160 | libpod/service.go:259-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/service.go:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) libpod/sqlite_state.go:2272— libpod/sqlite_state.go:2272-2286 | libpod/sqlite_state.go:2325-2339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:2272` 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) pkg/api/handlers/libpod/images.go:730— pkg/api/handlers/libpod/images.go:730-744 | pkg/api/handlers/libpod/manifests.go:777-791 — 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 `pkg/api/handlers/libpod/images.go:730` 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) pkg/api/handlers/libpod/images_push.go:139— pkg/api/handlers/libpod/images_push.go:139-153 | pkg/api/handlers/libpod/manifests.go:452-466 — before extracting anything, compare `pkg/api/handlers/libpod/images_push.go` and `pkg/api/handlers/libpod/manifests.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images_push.go:139` it begins part-way through the construct above it, so those exact lines 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) pkg/domain/infra/runtime_libpod.go:236— pkg/domain/infra/runtime_libpod.go:236-250 | REDACTED:981-995 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/domain/infra/runtime_libpod.go:236` it begins part-way through the construct above it, so those exact lines 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) pkg/specgen/generate/oci_freebsd.go:153— pkg/specgen/generate/oci_freebsd.go:153-167 | pkg/specgen/generate/oci_linux.go:345-359 — before extracting anything, compare `pkg/specgen/generate/oci_freebsd.go` and `pkg/specgen/generate/oci_linux.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) pkg/systemd/parser/split.go:118— pkg/systemd/parser/split.go:118-132 | pkg/systemd/parser/split.go:142-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 3) pkg/api/handlers/compat/volumes.go:149— pkg/api/handlers/compat/volumes.go:149-156 | pkg/api/handlers/libpod/volumes.go:46-53 | pkg/domain/infra/abi/volumes.go:22-29 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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.
Duplicated block (8 lines × 3) pkg/domain/infra/tunnel/containers.go:93— pkg/domain/infra/tunnel/containers.go:93-100 | pkg/domain/infra/tunnel/containers.go:118-125 | pkg/domain/infra/tunnel/containers.go:222-229 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) pkg/specgenutil/specgen.go:1087— pkg/specgenutil/specgen.go:1087-1094 | pkg/specgenutil/specgen.go:1113-1120 | pkg/specgenutil/specgen.go:1135-1142 — all 3 copies are in the same file, so extract the block into one function there and call 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/specgenutil/specgen.go:1087` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) cmd/podman/networks/list.go:103— cmd/podman/networks/list.go:103-110 | cmd/podman/quadlet/list.go:106-113 | cmd/podman/volumes/list.go:132-139 — 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 (8 lines × 3) cmd/podman/networks/disconnect.go:30— cmd/podman/networks/disconnect.go:30-37 | cmd/podman/networks/list.go:55-62 | cmd/podman/networks/rm.go:43-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) pkg/api/handlers/compat/images.go:186— pkg/api/handlers/compat/images.go:186-193 | pkg/api/handlers/libpod/containers.go:131-138 | pkg/api/handlers/libpod/images.go:435-442 — 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 `pkg/api/handlers/compat/images.go:186` it begins part-way through the construct above it, so those 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) REDACTED:199— REDACTED:199-206 | REDACTED:292-299 | REDACTED:351-358 — all 3 copies are in the same file, so extract the block into one function there and call 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: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. 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) pkg/api/handlers/libpod/pods.go:299— pkg/api/handlers/libpod/pods.go:299-306 | pkg/api/handlers/libpod/pods.go:350-357 | pkg/api/handlers/libpod/pods.go:376-383 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (5 members, 50+ identical tokens) cmd/podman/containers/pause.go:88— cmd/podman/containers/pause.go:88-124 | cmd/podman/containers/restart.go:95-136 | cmd/podman/containers/rm.go:103-140 | cmd/podman/containers/stop.go:103-158 | cmd/podman/containers/unpause.go:86-123 — 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) pkg/api/handlers/compat/containers.go:242— pkg/api/handlers/compat/containers.go:242-309 | pkg/api/handlers/compat/secrets.go:54-97 | pkg/api/handlers/libpod/containers_stats.go:19-83 | pkg/api/handlers/REDACTED:260-284 | pkg/api/handlers/libpod/system.go:74-116 — 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) pkg/api/handlers/libpod/networks.go:21— pkg/api/handlers/libpod/networks.go:21-54 | pkg/api/handlers/libpod/networks.go:103-146 | pkg/api/handlers/libpod/networks.go:149-171 | pkg/api/handlers/libpod/networks.go:205-225 | pkg/api/handlers/libpod/networks.go:228-255 — 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) pkg/api/handlers/libpod/pods.go:110— pkg/api/handlers/libpod/pods.go:110-128 | pkg/api/handlers/libpod/pods.go:196-238 | pkg/api/handlers/libpod/pods.go:284-308 | pkg/api/handlers/libpod/pods.go:335-359 | pkg/api/handlers/libpod/pods.go:361-385 — 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) pkg/bindings/containers/containers.go:105— pkg/bindings/containers/containers.go:105-125 | pkg/bindings/containers/diff.go:12-33 | pkg/bindings/generate/generate.go:13-34 | pkg/bindings/images/images.go:85-105 | pkg/bindings/secrets/secrets.go:33-52 — 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) pkg/bindings/containers/containers.go:130— pkg/bindings/containers/containers.go:130-149 | pkg/bindings/containers/containers.go:174-193 | pkg/bindings/containers/containers.go:198-217 | pkg/bindings/containers/rename.go:11-30 | pkg/bindings/volumes/rename.go:11-30 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (17 lines × 2) cmd/podman/artifact/pull.go:63— cmd/podman/artifact/pull.go:63-79 | cmd/podman/images/pull.go:117-133 — `cmd/podman/artifact/pull.go` and `cmd/podman/images/pull.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 43 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/artifact/pull.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 (17 lines × 2) libpod/container_api.go:50— libpod/container_api.go:50-66 | libpod/container_internal.go:834-850 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) REDACTED:279— REDACTED:279-295 | REDACTED:333-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:279` it begins part-way through the construct above it, so those 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) pkg/domain/infra/abi/play.go:363— pkg/domain/infra/abi/play.go:363-379 | pkg/domain/infra/abi/play.go:491-507 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also 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) pkg/specgen/generate/config_freebsd.go:33— pkg/specgen/generate/config_freebsd.go:33-49 | pkg/specgen/generate/config_linux.go:40-56 — before extracting anything, compare `pkg/specgen/generate/config_freebsd.go` and `pkg/specgen/generate/config_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/config_freebsd.go:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pkg/specgen/generate/config_freebsd.go:51` calls `addDevice` and `pkg/specgen/generate/config_linux.go:57` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) pkg/systemd/parser/unitfile.go:705— pkg/systemd/parser/unitfile.go:705-721 | pkg/systemd/parser/unitfile.go:738-754 — both copies are in the same file, so extract the 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.
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/podman/common/completion.go:179— cmd/podman/common/completion.go:179-199 | cmd/podman/common/completion.go:201-222 | cmd/podman/common/completion.go:358-379 | cmd/podman/machine/machine.go:116-137 — 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) libpod/container_api.go:45— libpod/container_api.go:45-79 | libpod/container_internal.go:823-868 | libpod/container_internal.go:1208-1257 | libpod/container_internal.go:1681-1742 — 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:616— REDACTED:616-650 | REDACTED:654-717 | REDACTED:721-761 | REDACTED:765-814 — 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/api/handlers/compat/containers_pause.go:13— pkg/api/handlers/compat/containers_pause.go:13-31 | pkg/api/handlers/compat/containers_start.go:17-48 | pkg/api/handlers/compat/containers_unpause.go:13-31 | pkg/api/handlers/libpod/containers.go:163-178 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/api/handlers/libpod/artifacts.go:62— pkg/api/handlers/libpod/artifacts.go:62-147 | pkg/api/handlers/libpod/artifacts.go:229-250 | pkg/api/handlers/libpod/artifacts.go:252-290 | pkg/api/handlers/libpod/images.go:380-422 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (10 lines × 4) libpod/container_api.go:60— libpod/container_api.go:60-70 | libpod/container_internal.go:844-854 | libpod/container_internal.go:1226-1236 | libpod/container_internal.go:1715-1724 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libpod/container_internal.go:1241` calls `Debugf`, `ID` and `libpod/container_internal.go:858` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) pkg/bindings/containers/containers.go:111— pkg/bindings/containers/containers.go:111-120 | pkg/bindings/containers/diff.go:18-28 | pkg/bindings/generate/generate.go:19-29 | pkg/bindings/images/images.go:92-101 — `pkg/bindings/containers/containers.go` and `pkg/bindings/images/images.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) pkg/domain/infra/tunnel/containers.go:333— pkg/domain/infra/tunnel/containers.go:333-342 | pkg/domain/infra/tunnel/pods.go:236-245 | pkg/domain/infra/tunnel/secrets.go:38-47 | pkg/domain/infra/tunnel/volumes.go:63-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/tunnel/containers.go:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) pkg/bindings/containers/containers.go:59— pkg/bindings/containers/containers.go:59-68 | pkg/bindings/system/system.go:67-76 | pkg/bindings/system/system.go:87-96 | pkg/bindings/volumes/volumes.go:87-96 — `pkg/bindings/containers/containers.go` and `pkg/bindings/volumes/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 4) pkg/bindings/images/images.go:44— pkg/bindings/images/images.go:44-53 | pkg/bindings/network/network.go:120-129 | pkg/bindings/secrets/secrets.go:16-25 | pkg/bindings/volumes/volumes.go:66-75 — 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 `pkg/bindings/images/images.go:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) pkg/api/handlers/compat/networks.go:134— pkg/api/handlers/compat/networks.go:134-138 | pkg/api/handlers/compat/networks.go:430-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) pkg/api/handlers/REDACTED:243— pkg/api/handlers/REDACTED:243-247 | pkg/api/handlers/libpod/networks.go:39-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/REDACTED:243` it begins part-way through the construct above it, so those exact lines 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) pkg/domain/infra/abi/containers.go:256— pkg/domain/infra/abi/containers.go:256-260 | pkg/domain/infra/abi/containers.go:277-281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/containers.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 (5 lines × 2) libpod/runtime_ctr.go:845— libpod/runtime_ctr.go:845-849 | libpod/runtime_ctr.go:865-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/runtime_ctr.go:845` it begins part-way through the construct above it, so those exact lines 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) pkg/specgen/generate/storage.go:176— pkg/specgen/generate/storage.go:176-180 | pkg/specgen/generate/storage.go:184-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/storage.go:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Low cohesion: ContainerEngine (LCOM4 8) pkg/domain/infra/abi/runtime.go:18— ContainerEngine's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ConmonOCIRuntime (LCOM4 7) REDACTED:54— ConmonOCIRuntime's methods fall into 7 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 7 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: sshStdioConn (LCOM4 4) pkg/bindings/connection_stdio.go:105— sshStdioConn'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: ImageEngine (LCOM4 4) pkg/domain/infra/abi/runtime.go:12— ImageEngine'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: QEMUStubber (LCOM4 4) REDACTED:27— QEMUStubber'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.
Change coupling: config.go ↔ machine.go pkg/machine/applehv/config.go:1— `pkg/machine/applehv/config.go` and `pkg/machine/applehv/machine.go` change together 80% of the time (8 of the 10 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 8 shared commits counted here, the most recent 3 are `f6107f63` Assign separate ports for each appleHV machine; `c23963d7` machine: qemu: add usb host passthrough; `b2c56365` Refactor Ignition configuration for virt providers — run `git show` on any of them.
Change coupling: types.go ↔ REDACTED pkg/bindings/images/types.go:1— `pkg/bindings/images/types.go` and `pkg/domain/entities/images.go` change together 80% of the time (8 of the 10 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `af579ec2` Add --platform to podman push; `901f621d` prune: support clearing build cache using CleanCacheMount; `c3c0c4ab` Add support for podman push --retry --retry-delay — run `git show` on any of them.
Change coupling: config.go ↔ machine.go pkg/machine/qemu/config.go:1— `pkg/machine/qemu/config.go` and `pkg/machine/qemu/machine.go` change together 75% of the time (9 of the 12 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 9 shared commits counted here, the most recent 3 are `2b95700b` No longer support deprecated legacy QEMU machine structures; `c23963d7` machine: qemu: add usb host passthrough; `b2c56365` Refactor Ignition configuration for virt providers — run `git show` on any of them.
Change coupling: vfkit.go ↔ helper.go pkg/machine/apple/vfkit.go:1— `pkg/machine/apple/vfkit.go` and `pkg/machine/apple/vfkit/helper.go` change together 50% of the time (5 of the 10 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) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `fe7cc67e` Add Rosetta support for Apple Silicon mac; `d2c1de59` Add krun support to podman machine; `19b676f8` Enable lint for Darwin and fix identified issues (at that commit the files were still `pkg/machine/applehv/vfkit.go` and `pkg/machine/applehv/vfkit/config.go`) — run `git show` on any of them.
Duplicated block (18 lines × 2) pkg/api/handlers/compat/containers_restart.go:52— pkg/api/handlers/compat/containers_restart.go:52-69 | pkg/api/handlers/compat/containers_stop.go:68-85 — before extracting anything, compare `pkg/api/handlers/compat/containers_restart.go` and `pkg/api/handlers/compat/containers_stop.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers_restart.go:52` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) pkg/domain/filters/containers.go:420— pkg/domain/filters/containers.go:420-437 | pkg/domain/filters/containers.go:441-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:420` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) pkg/domain/infra/abi/containers.go:944— pkg/domain/infra/abi/containers.go:944-961 | pkg/domain/infra/abi/containers.go:973-990 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) pkg/domain/infra/runtime_libpod.go:258— pkg/domain/infra/runtime_libpod.go:258-275 | REDACTED:997-1014 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 × 3) pkg/api/handlers/compat/containers.go:81— pkg/api/handlers/compat/containers.go:81-90 | pkg/api/handlers/compat/containers_restart.go:52-62 | pkg/api/handlers/compat/containers_stop.go:68-78 — before extracting anything, compare `pkg/api/handlers/compat/containers_restart.go` and `pkg/api/handlers/compat/containers_stop.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers.go:81` it does not close everything it opens, so those exact lines 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) pkg/bindings/containers/containers.go:63— pkg/bindings/containers/containers.go:63-72 | pkg/bindings/network/network.go:226-236 | pkg/bindings/volumes/volumes.go:91-100 — `pkg/bindings/containers/containers.go` and `pkg/bindings/volumes/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (10 lines × 3) pkg/bindings/network/network.go:61— pkg/bindings/network/network.go:61-70 | pkg/bindings/network/network.go:158-168 | pkg/bindings/network/network.go:187-197 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/network/network.go:61` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (10 lines × 3) libpod/sqlite_state.go:152— libpod/sqlite_state.go:152-161 | libpod/sqlite_state.go:184-193 | libpod/sqlite_state.go:217-226 — all 3 copies are in the same file, so extract the block into one function there and call 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 `libpod/sqlite_state.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 (7 lines × 3) REDACTED:294— REDACTED:294-300 | REDACTED:348-354 | REDACTED:505-511 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) pkg/api/handlers/compat/volumes.go:201— pkg/api/handlers/compat/volumes.go:201-207 | pkg/api/handlers/libpod/volumes.go:100-106 | pkg/api/handlers/libpod/volumes.go:233-240 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. 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 × 3) pkg/api/handlers/libpod/networks.go:150— pkg/api/handlers/libpod/networks.go:150-156 | pkg/api/handlers/libpod/networks.go:206-212 | pkg/api/handlers/libpod/networks.go:229-235 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) libpod/sqlite_state.go:1321— libpod/sqlite_state.go:1321-1327 | libpod/sqlite_state.go:1377-1383 | libpod/sqlite_state.go:2178-2184 — all 3 copies are in the same file, so extract the block into one function there and call 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 `libpod/sqlite_state.go:1321` it does not close everything it opens, so those 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 (5 lines × 3) REDACTED:436— REDACTED:436-440 | REDACTED:446-450 | REDACTED:456-460 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) pkg/api/handlers/compat/containers.go:761— pkg/api/handlers/compat/containers.go:761-765 | pkg/api/handlers/libpod/containers.go:468-475 | pkg/api/handlers/libpod/volumes.go:288-292 — 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 `pkg/api/handlers/compat/containers.go:761` it begins part-way through the construct above it, so those 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 (5 lines × 3) libpod/lock/file_lock_manager.go:110— libpod/lock/file_lock_manager.go:110-114 | libpod/lock/file_lock_manager.go:117-121 | libpod/lock/shm_lock_manager_linux.go:126-130 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) libpod/sqlite_state.go:1699— libpod/sqlite_state.go:1699-1703 | libpod/sqlite_state.go:2045-2049 | libpod/sqlite_state_internal.go:437-441 — 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 `libpod/sqlite_state.go:1699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Outbound HTTP without resilience cmd/podman/kube/play.go:441— `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience pkg/machine/apple/vfkit/helper.go:27— `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 pkg/machine/apple/vfkit/helper.go:36— `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 pkg/machine/stdpull/url.go:93— `http.Get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
XxxComment pkg/systemd/quadlet/quadlet.go:989— // XXX: only %N is handled. — 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.
XxxComment pkg/systemd/quadlet/quadlet.go:2257— // XXX: only %N is handled. — 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.
XxxComment pkg/systemd/quadlet/quadlet.go:1870— // XXX: this is usually because a '@' in service name — 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.
Duplicated block (14 lines × 2) cmd/podman/artifact/list.go:212— cmd/podman/artifact/list.go:212-225 | cmd/podman/machine/list.go:126-139 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/artifact/list.go:212` it begins part-way through the construct above it, so those 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, `cmd/podman/machine/list.go:125` calls `Parse` and `cmd/podman/artifact/list.go:211` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) pkg/specgen/generate/oci_freebsd.go:138— pkg/specgen/generate/oci_freebsd.go:138-151 | pkg/specgen/generate/oci_linux.go:326-339 — before extracting anything, compare `pkg/specgen/generate/oci_freebsd.go` and `pkg/specgen/generate/oci_linux.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) pkg/systemd/generate/containers.go:493— pkg/systemd/generate/containers.go:493-506 | pkg/systemd/generate/pods.go:377-390 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 3) libpod/sqlite_state.go:846— libpod/sqlite_state.go:846-856 | libpod/sqlite_state.go:876-886 | libpod/sqlite_state.go:1628-1638 — all 3 copies are in the same file, so extract the block into one function there and call 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 `libpod/sqlite_state.go:846` it begins part-way through the construct above it, so those 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, `libpod/sqlite_state.go:857` calls `Unmarshal`, `Errorf`, `ID` and `libpod/sqlite_state.go:888` 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 × 3) pkg/bindings/images/pull.go:59— pkg/bindings/images/pull.go:59-69 | pkg/bindings/images/push.go:59-69 | pkg/bindings/manifests/manifests.go:277-287 — 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 (11 lines × 3) pkg/bindings/containers/containers.go:159— pkg/bindings/containers/containers.go:159-169 | pkg/bindings/containers/containers.go:326-336 | pkg/bindings/containers/mount.go:39-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:159` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 3) pkg/domain/infra/abi/play.go:389— pkg/domain/infra/abi/play.go:389-397 | pkg/domain/infra/abi/play.go:408-416 | pkg/domain/infra/abi/play.go:478-486 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) pkg/domain/infra/abi/play.go:672— pkg/domain/infra/abi/play.go:672-680 | pkg/domain/infra/abi/play.go:696-704 | pkg/domain/infra/abi/play.go:720-728 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/play.go:672` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/domain/infra/abi/play.go:671` calls `Sprintf` and `pkg/domain/infra/abi/play.go:694` 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 × 3) pkg/api/handlers/libpod/pods.go:186— pkg/api/handlers/libpod/pods.go:186-194 | pkg/api/handlers/libpod/pods.go:300-308 | pkg/api/handlers/libpod/pods.go:351-359 — all 3 copies are in the same file, so extract the block into one function there and call 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/api/handlers/libpod/pods.go:186` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 5) cmd/podman/images/exists.go:27— cmd/podman/images/exists.go:27-36 | cmd/podman/manifest/exists.go:26-35 | cmd/podman/networks/exists.go:29-38 | cmd/podman/secrets/exists.go:27-36 | cmd/podman/volumes/exists.go:29-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Duplicated block (10 lines × 5) pkg/bindings/images/images.go:24— pkg/bindings/images/images.go:24-33 | pkg/bindings/manifests/manifests.go:67-76 | pkg/bindings/network/network.go:202-211 | pkg/bindings/secrets/secrets.go:94-103 | pkg/bindings/volumes/volumes.go:125-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. 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 (10 lines × 5) pkg/bindings/containers/containers.go:37— pkg/bindings/containers/containers.go:37-46 | pkg/bindings/images/images.go:49-58 | pkg/bindings/network/network.go:125-134 | pkg/bindings/secrets/secrets.go:21-30 | pkg/bindings/volumes/volumes.go:71-80 — `pkg/bindings/containers/containers.go` and `pkg/bindings/images/images.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:37` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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.
ContainerEngine.ContainerStart (cyclomatic 17) pkg/domain/infra/abi/containers.go:1036— ContainerEngine.ContainerStart 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ContainerEngine.ContainerStart (cyclomatic 17) pkg/domain/infra/tunnel/containers.go:798— ContainerEngine.ContainerStart 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HackComment libpod/oci_conmon_exec_common.go:639— // Hack: return immediately if attachStdout not set to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment REDACTED:648— // Hack: return immediately if attachStdout not set to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) cmd/podman/containers/init.go:66— cmd/podman/containers/init.go:66-84 | cmd/podman/containers/kill.go:83-122 | cmd/podman/containers/pause.go:88-124 | cmd/podman/containers/restart.go:95-136 | cmd/podman/containers/stop.go:103-158 | cmd/podman/containers/unpause.go:86-123 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) pkg/domain/infra/abi/pods.go:61— pkg/domain/infra/abi/pods.go:61-90 | pkg/domain/infra/abi/pods.go:132-156 | pkg/domain/infra/abi/pods.go:158-190 | pkg/domain/infra/abi/pods.go:192-219 | pkg/domain/infra/abi/pods.go:221-245 | pkg/domain/infra/abi/pods.go:247-275 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (20 lines × 2) REDACTED:645— REDACTED:645-664 | libpod/oci_conmon_exec_common.go:636-655 — 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) libpod/sqlite_state.go:873— libpod/sqlite_state.go:873-892 | libpod/sqlite_state.go:1625-1644 — both copies are in the same file, so extract the 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 (19–20 lines × 2) REDACTED:1574— REDACTED:1574-1592 | REDACTED:1660-1679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1574` 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 (19–20 lines × 2) pkg/domain/infra/abi/containers.go:1418— pkg/domain/infra/abi/containers.go:1418-1436 | pkg/domain/infra/abi/images.go:163-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) libpod/container_internal_freebsd.go:237— libpod/container_internal_freebsd.go:237-255 | libpod/container_internal_linux.go:439-457 — before extracting anything, compare `libpod/container_internal_freebsd.go` and `libpod/container_internal_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) pkg/api/handlers/libpod/artifacts.go:264— pkg/api/handlers/libpod/artifacts.go:264-282 | pkg/api/handlers/libpod/images.go:394-412 — 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 `pkg/api/handlers/libpod/artifacts.go:264` it begins part-way through the construct above it, so those 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 × 4) REDACTED:617— REDACTED:617-629 | REDACTED:655-667 | REDACTED:722-734 | REDACTED:766-778 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:669` calls `Infof`, `ID` and `REDACTED:631` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 4) libpod/pod_api.go:302— libpod/pod_api.go:302-314 | libpod/pod_api.go:363-375 | libpod/pod_api.go:419-431 | libpod/pod_api.go:534-546 — 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 `libpod/pod_api.go:302` it does not close everything it opens, so those 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, `libpod/pod_api.go:361` calls `newPodEvent` and `libpod/pod_api.go:300` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) pkg/domain/infra/abi/images.go:184— pkg/domain/infra/abi/images.go:184-195 | pkg/domain/infra/abi/images.go:246-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/images.go:184` it does not close everything it opens, so those 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.
Duplicated block (12–13 lines × 2) pkg/specgen/namespaces.go:174— pkg/specgen/namespaces.go:174-186 | pkg/specgen/namespaces.go:215-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/namespaces.go:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) cmd/podman/common/completion.go:300— cmd/podman/common/completion.go:300-310 | cmd/podman/common/completion.go:338-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/common/completion.go:300` it does not close everything it opens, so those exact lines 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) libpod/events/journal_linux.go:130— libpod/events/journal_linux.go:130-141 | REDACTED:114-124 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 5) cmd/podman/containers/pause.go:95— cmd/podman/containers/pause.go:95-105 | cmd/podman/containers/restart.go:107-117 | cmd/podman/containers/rm.go:117-127 | cmd/podman/containers/stop.go:121-131 | cmd/podman/containers/unpause.go:93-103 — before extracting anything, compare `cmd/podman/containers/pause.go` and `cmd/podman/containers/unpause.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/pause.go:95` it begins part-way through the construct above it, so those 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, `cmd/podman/containers/rm.go:114` calls `Is` and `cmd/podman/containers/pause.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 × 5) pkg/bindings/containers/containers.go:135— pkg/bindings/containers/containers.go:135-145 | pkg/bindings/containers/containers.go:179-189 | pkg/bindings/containers/containers.go:203-213 | pkg/bindings/containers/rename.go:16-26 | pkg/bindings/volumes/rename.go:16-26 — `pkg/bindings/containers/rename.go` and `pkg/bindings/volumes/rename.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 22 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) cmd/podman/common/completion.go:105— cmd/podman/common/completion.go:105-114 | cmd/podman/common/completion.go:385-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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/podman/common/completion.go:119` calls `Flags`, `GetBool` and `cmd/podman/common/completion.go:397` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) pkg/domain/infra/abi/containers.go:1444— pkg/domain/infra/abi/containers.go:1444-1454 | pkg/domain/infra/abi/containers.go:1551-1560 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/containers.go:1444` it begins part-way through the construct above it, so those exact lines 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 × 7) pkg/api/handlers/compat/containers_prune.go:22— pkg/api/handlers/compat/containers_prune.go:22-26 | pkg/api/handlers/compat/images_prune.go:25-29 | pkg/api/handlers/compat/networks.go:260-264 | pkg/api/handlers/compat/secrets.go:23-27 | pkg/api/handlers/compat/volumes.go:28-33 | pkg/api/handlers/libpod/networks.go:84-89 | pkg/api/handlers/libpod/volumes.go:120-125 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. 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 × 7) pkg/api/handlers/compat/containers.go:761— pkg/api/handlers/compat/containers.go:761-765 | pkg/api/handlers/compat/exec.go:245-249 | pkg/api/handlers/compat/images.go:269-275 | pkg/api/handlers/compat/images.go:527-534 | pkg/api/handlers/libpod/containers.go:468-475 | pkg/api/handlers/libpod/system.go:29-35 | pkg/api/handlers/libpod/volumes.go:288-292 — there are 7 copies across 6 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers.go:761` it begins part-way through the construct above it, so those 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 lines × 5) pkg/bindings/containers/containers.go:110— pkg/bindings/containers/containers.go:110-118 | pkg/bindings/containers/diff.go:17-26 | pkg/bindings/generate/generate.go:18-27 | pkg/bindings/images/images.go:91-99 | pkg/bindings/secrets/secrets.go:39-47 — `pkg/bindings/containers/containers.go` and `pkg/bindings/images/images.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:110` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) pkg/bindings/containers/containers.go:58— pkg/bindings/containers/containers.go:58-66 | pkg/bindings/images/images.go:199-207 | pkg/bindings/system/system.go:66-74 | pkg/bindings/system/system.go:86-94 | pkg/bindings/volumes/volumes.go:86-94 — `pkg/bindings/containers/containers.go` and `pkg/bindings/images/images.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/containers/containers.go:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) pkg/bindings/artifacts/list.go:13— pkg/bindings/artifacts/list.go:13-22 | pkg/bindings/system/info.go:13-21 | pkg/bindings/system/system.go:117-125 | pkg/bindings/system/system.go:159-167 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (9 lines × 4) pkg/bindings/containers/containers.go:157— pkg/bindings/containers/containers.go:157-165 | pkg/bindings/containers/containers.go:324-332 | pkg/bindings/containers/containers.go:445-453 | pkg/bindings/containers/mount.go:37-45 — 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. 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.
specgenutil.FillOutSpecGen (cyclomatic 199) pkg/specgenutil/specgen.go:334— specgenutil.FillOutSpecGen has cyclomatic complexity 199 (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.
Container.generateSpec (cyclomatic 157) REDACTED:235— Container.generateSpec has cyclomatic complexity 157 (threshold 15). Of this number, 155 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.
ContainerEngine.playKubePod (cyclomatic 129) pkg/domain/infra/abi/play.go:730— ContainerEngine.playKubePod has cyclomatic complexity 129 (threshold 15). Of this number, 128 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.
images.prepareParams (cyclomatic 117) REDACTED:135— images.prepareParams has cyclomatic complexity 117 (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.
kube.ToSpecGen (cyclomatic 104) pkg/specgen/generate/kube/kube.go:209— kube.ToSpecGen has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.restore (cyclomatic 101) REDACTED:1625— Container.restore has cyclomatic complexity 101 (threshold 15). Of this number, 95 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.
generate.createContainerOptions (cyclomatic 100) pkg/specgen/generate/container_create.go:383— generate.createContainerOptions has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Runtime.setupContainer (cyclomatic 98) libpod/runtime_ctr.go:245— Runtime.setupContainer has cyclomatic complexity 98 (threshold 15). Of this number, 94 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
common.buildFlagsWrapperToOptions (cyclomatic 97) cmd/podman/common/build.go:316— common.buildFlagsWrapperToOptions has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.namespaceOptions (cyclomatic 97) pkg/specgen/generate/namespaces.go:124— generate.namespaceOptions has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compat.cliOpts (cyclomatic 93) pkg/api/handlers/compat/containers_create.go:214— compat.cliOpts has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.MakeContainer (cyclomatic 90) pkg/specgen/generate/container_create.go:33— generate.MakeContainer has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compat.createBuildOptions (cyclomatic 86) pkg/api/handlers/compat/images_build.go:406— compat.createBuildOptions has cyclomatic complexity 86 (threshold 15). Of this number, 82 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
filters.GenerateContainerFilterFuncs (cyclomatic 85) pkg/domain/filters/containers.go:51— filters.GenerateContainerFilterFuncs has cyclomatic complexity 85 (threshold 15). Of this number, 43 points are the body's own statements and 42 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.
Runtime.removeContainer (cyclomatic 80) libpod/runtime_ctr.go:705— Runtime.removeContainer has cyclomatic complexity 80 (threshold 15). Of this number, 78 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.
ContainerEngine.PlayKube (cyclomatic 75) pkg/domain/infra/abi/play.go:237— ContainerEngine.PlayKube has cyclomatic complexity 75 (threshold 15). Of this number, 67 points are the body's own statements and 8 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.
libpod.makeRuntime (cyclomatic 69) libpod/runtime.go:330— libpod.makeRuntime has cyclomatic complexity 69 (threshold 15). Of this number, 60 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.validate (cyclomatic 66) libpod/container_validate.go:19— Container.validate has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
specgenutil.parseMountOptions (cyclomatic 66) pkg/specgenutil/volumes.go:317— specgenutil.parseMountOptions has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
util.processOptionsInternal (cyclomatic 66) pkg/util/mount_opts.go:36— util.processOptionsInternal has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.CompleteSpec (cyclomatic 63) pkg/specgen/generate/container.go:143— generate.CompleteSpec has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
quadlet.ConvertContainer (cyclomatic 63) pkg/systemd/quadlet/quadlet.go:605— quadlet.ConvertContainer has cyclomatic complexity 63 (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.
common.NetFlagsToNetOptions (cyclomatic 62) cmd/podman/common/netflags.go:109— common.NetFlagsToNetOptions has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.makeBindMounts (cyclomatic 58) REDACTED:2069— Container.makeBindMounts has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConmonOCIRuntime.createOCIContainer (cyclomatic 56) REDACTED:1018— ConmonOCIRuntime.createOCIContainer has cyclomatic complexity 56 (threshold 15). Of this number, 54 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.
filters.GenerateExternalContainerFilterFuncs (cyclomatic 55) pkg/domain/filters/containers.go:367— filters.GenerateExternalContainerFilterFuncs has cyclomatic complexity 55 (threshold 15). Of this number, 37 points are the body's own statements and 18 belong to 6 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.
containers.CreateInit (cyclomatic 51) cmd/podman/containers/create.go:234— containers.CreateInit has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.mountStorage (cyclomatic 51) libpod/container_internal.go:1749— Container.mountStorage has cyclomatic complexity 51 (threshold 15). Of this number, 43 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
containers.Attach (cyclomatic 51) REDACTED:40— containers.Attach has cyclomatic complexity 51 (threshold 15). Of this number, 46 points are the body's own statements and 5 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.
Runtime.newVolume (cyclomatic 50) libpod/runtime_volume_common.go:48— Runtime.newVolume has cyclomatic complexity 50 (threshold 15). Of this number, 46 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
shim.startLocked (cyclomatic 50) pkg/machine/shim/host.go:558— shim.startLocked has cyclomatic complexity 50 (threshold 15). Of this number, 47 points are the body's own statements and 3 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.
generate.ConfigToSpec (cyclomatic 49) pkg/specgen/generate/container.go:382— generate.ConfigToSpec has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parser.extractFirstWord (cyclomatic 48) pkg/systemd/parser/split.go:219— parser.extractFirstWord has cyclomatic complexity 48 (threshold 15). Of this number, 47 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.
libpod.ManifestModify (cyclomatic 47) pkg/api/handlers/libpod/manifests.go:494— libpod.ManifestModify has cyclomatic complexity 47 (threshold 15). Of this number, 36 points are the body's own statements and 11 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.
generate.finalizeMounts (cyclomatic 47) pkg/specgen/generate/storage.go:28— generate.finalizeMounts has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Runtime.Reset (cyclomatic 46) libpod/reset.go:95— Runtime.Reset has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SpecGenerator.Validate (cyclomatic 45) pkg/specgen/container_validate.go:27— SpecGenerator.Validate has cyclomatic complexity 45 (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.
common.ParseBuildOpts (cyclomatic 44) cmd/podman/common/build.go:147— common.ParseBuildOpts has cyclomatic complexity 44 (threshold 15). Of this number, 40 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.
libpod.ImagesPull (cyclomatic 44) pkg/api/handlers/libpod/images_pull.go:33— libpod.ImagesPull has cyclomatic complexity 44 (threshold 15). Of this number, 35 points are the body's own statements and 9 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.
containers.restore (cyclomatic 43) cmd/podman/containers/restore.go:93— containers.restore has cyclomatic complexity 43 (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.
filters.GeneratePodFilterFunc (cyclomatic 43) pkg/domain/filters/pods.go:21— filters.GeneratePodFilterFunc has cyclomatic complexity 43 (threshold 15). Of this number, 19 points are the body's own statements and 24 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
infra.getRuntime (cyclomatic 43) pkg/domain/infra/runtime_libpod.go:56— infra.getRuntime has cyclomatic complexity 43 (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.
rootless.becomeRootInUserNS (cyclomatic 43) REDACTED:216— rootless.becomeRootInUserNS has cyclomatic complexity 43 (threshold 15). Of this number, 37 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.
kube.setupSecurityContext (cyclomatic 43) pkg/specgen/generate/kube/kube.go:974— kube.setupSecurityContext has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.executeContainerTemplate (cyclomatic 43) pkg/systemd/generate/containers.go:287— generate.executeContainerTemplate has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parser.cUnescapeOne (cyclomatic 43) pkg/systemd/parser/split.go:57— parser.cUnescapeOne has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.persistentPreRunE (cyclomatic 42) cmd/podman/root.go:270— main.persistentPreRunE has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
containers.run (cyclomatic 42) cmd/podman/containers/run.go:105— containers.run has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
libpod.containerToV1Container (cyclomatic 42) REDACTED:909— libpod.containerToV1Container has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.readFromJournal (cyclomatic 42) libpod/container_log_unsupported.go:13— Container.readFromJournal has cyclomatic complexity 42 (threshold 15). Of this number, 18 points are the body's own statements and 24 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.
ContainerEngine.GenerateKube (cyclomatic 42) pkg/domain/infra/abi/generate.go:113— ContainerEngine.GenerateKube has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.generatePasswdAndGroup (cyclomatic 41) REDACTED:2910— Container.generatePasswdAndGroup 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.
checkpoint.CRImportCheckpoint (cyclomatic 41) pkg/checkpoint/checkpoint_restore.go:47— checkpoint.CRImportCheckpoint 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.
libpod.GetLimits (cyclomatic 40) libpod/oci_conmon_linux.go:234— libpod.GetLimits has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ConmonOCIRuntime.HTTPAttach (cyclomatic 40) REDACTED:482— ConmonOCIRuntime.HTTPAttach has cyclomatic complexity 40 (threshold 15). Of this number, 26 points are the body's own statements and 14 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.
utils.ExecuteTransfer (cyclomatic 40) pkg/domain/utils/scp.go:21— utils.ExecuteTransfer has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
shim.Init (cyclomatic 40) pkg/machine/shim/host.go:72— shim.Init has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 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.
generate.ParsePortMapping (cyclomatic 40) pkg/specgen/generate/ports.go:148— generate.ParsePortMapping has cyclomatic complexity 40 (threshold 15). Of this number, 37 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.
kube.play (cyclomatic 39) cmd/podman/kube/play.go:234— kube.play has cyclomatic complexity 39 (threshold 15). Of this number, 37 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.
ContainerEngine.PlayKubeDown (cyclomatic 39) pkg/domain/infra/abi/play.go:1821— ContainerEngine.PlayKubeDown has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compat.LibpodToContainerJSON (cyclomatic 38) pkg/api/handlers/compat/containers.go:513— compat.LibpodToContainerJSON has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.runHealthCheck (cyclomatic 37) libpod/healthcheck.go:54— Container.runHealthCheck has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compat.LibpodToContainer (cyclomatic 36) pkg/api/handlers/compat/containers.go:326— compat.LibpodToContainer has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compat.PushImage (cyclomatic 36) pkg/api/handlers/compat/images_push.go:28— compat.PushImage has cyclomatic complexity 36 (threshold 15). Of this number, 33 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.
specgen.GenVolumeMounts (cyclomatic 36) pkg/specgen/volumes.go:89— specgen.GenVolumeMounts has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
inspector.inspect (cyclomatic 35) cmd/podman/inspect/inspect.go:78— inspector.inspect has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
libpod.simplePodWithV1Containers (cyclomatic 35) REDACTED:742— libpod.simplePodWithV1Containers has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
containers.ExecStartAndAttach (cyclomatic 35) REDACTED:410— containers.ExecStartAndAttach has cyclomatic complexity 35 (threshold 15). Of this number, 32 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.
images.nTar (cyclomatic 35) REDACTED:1133— images.nTar has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1148, 1297). 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.
Container.WaitForConditionWithInterval (cyclomatic 34) libpod/container_api.go:741— Container.WaitForConditionWithInterval has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 794, 779). 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.
Container.update (cyclomatic 34) libpod/container_internal.go:2840— Container.update 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.
images.prepareRemoteRequestBody (cyclomatic 34) REDACTED:701— images.prepareRemoteRequestBody has cyclomatic complexity 34 (threshold 15). Of this number, 23 points are the body's own statements and 11 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.
specgenutil.parseVolumes (cyclomatic 34) pkg/specgenutil/volumes.go:53— specgenutil.parseVolumes has cyclomatic complexity 34 (threshold 15). Of this number, 33 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.
specgenutil.mounts (cyclomatic 34) pkg/specgenutil/volumes.go:191— specgenutil.mounts has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 3 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 196). 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.
Container.Commit (cyclomatic 33) libpod/container_commit.go:39— Container.Commit has cyclomatic complexity 33 (threshold 15). Of this number, 32 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.
ContainerEngine.QuadletInstall (cyclomatic 33) pkg/domain/infra/abi/quadlet.go:29— ContainerEngine.QuadletInstall has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.process (cyclomatic 32) cmd/quadlet/main.go:527— main.process has cyclomatic complexity 32 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.copyFromArchive (cyclomatic 32) libpod/container_copy_common.go:27— Container.copyFromArchive has cyclomatic complexity 32 (threshold 15). Of this number, 17 points are the body's own statements and 15 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.fixVolumePermissionsUnlocked (cyclomatic 32) REDACTED:3098— Container.fixVolumePermissionsUnlocked has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SQLiteState.Refresh (cyclomatic 32) libpod/sqlite_state.go:119— SQLiteState.Refresh has cyclomatic complexity 32 (threshold 15). Of this number, 30 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.
generate.SpecGenToOCI (cyclomatic 32) pkg/specgen/generate/oci_linux.go:103— generate.SpecGenToOCI has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Container.checkpoint (cyclomatic 31) REDACTED:1393— Container.checkpoint has cyclomatic complexity 31 (threshold 15). Of this number, 28 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.
manifests.Modify (cyclomatic 31) pkg/bindings/manifests/manifests.go:316— manifests.Modify has cyclomatic complexity 31 (threshold 15). Of this number, 22 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.
abi.getContainers (cyclomatic 31) pkg/domain/infra/abi/containers.go:59— abi.getContainers has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
specgen.ParseNetworkFlag (cyclomatic 31) pkg/specgen/namespaces.go:317— specgen.ParseNetworkFlag has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.MapSpec (cyclomatic 31) pkg/specgen/generate/pod_create.go:172— generate.MapSpec has cyclomatic complexity 31 (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.
specgenutil.GetResources (cyclomatic 31) pkg/specgenutil/specgen.go:1318— specgenutil.GetResources has cyclomatic complexity 31 (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.
Container.NetworkConnect (cyclomatic 30) libpod/networking_common.go:529— Container.NetworkConnect 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.
Pod.podWithContainers (cyclomatic 30) REDACTED:569— Pod.podWithContainers 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.
Runtime.removeVolume (cyclomatic 30) libpod/runtime_volume_common.go:370— Runtime.removeVolume 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.
SQLiteState.ValidateDBConfig (cyclomatic 30) libpod/sqlite_state.go:304— SQLiteState.ValidateDBConfig has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 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.
containers.port (cyclomatic 29) cmd/podman/containers/port.go:68— containers.port 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.
libpod.attachExecHTTP (cyclomatic 29) libpod/oci_conmon_exec_common.go:493— libpod.attachExecHTTP has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
events.generateEventFilter (cyclomatic 29) libpod/events/filters.go:13— events.generateEventFilter has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 63, 16, …). 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.
Runtime.SystemCheck (cyclomatic 29) libpod/runtime.go:1392— Runtime.SystemCheck has cyclomatic complexity 29 (threshold 15). Of this number, 26 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.
compat.UpdateContainer (cyclomatic 29) pkg/api/handlers/compat/containers.go:785— compat.UpdateContainer 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.
compat.LogsFromContainer (cyclomatic 29) pkg/api/handlers/compat/containers_logs.go:23— compat.LogsFromContainer has cyclomatic complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ContainerEngine.ContainerMount (cyclomatic 29) pkg/domain/infra/abi/containers.go:1417— ContainerEngine.ContainerMount 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.
ContainerEngine.QuadletRemove (cyclomatic 29) pkg/domain/infra/abi/quadlet.go:577— ContainerEngine.QuadletRemove 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.
PodSpecGenerator.Validate (cyclomatic 29) pkg/specgen/pod_validate.go:18— PodSpecGenerator.Validate 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.
connection.add (cyclomatic 28) cmd/podman/system/connection/add.go:119— connection.add has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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.
main.parent (cyclomatic 28) cmd/rootlessport/main.go:79— main.parent has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 4 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.
Container.setupStorage (cyclomatic 28) libpod/container_internal.go:451— Container.setupStorage 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.
Container.exportCheckpoint (cyclomatic 28) REDACTED:1184— Container.exportCheckpoint has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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.
Runtime.evictContainer (cyclomatic 28) libpod/runtime_ctr.go:1078— Runtime.evictContainer 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.
Runtime.removePod (cyclomatic 28) libpod/runtime_pod_common.go:191— Runtime.removePod 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.
generate.GetDefaultNamespaceMode (cyclomatic 28) pkg/specgen/generate/namespaces.go:43— generate.GetDefaultNamespaceMode 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.
validate.CheckAllLatestAndIDFile (cyclomatic 27) cmd/podman/validate/args.go:55— validate.CheckAllLatestAndIDFile 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.
Container.execStartAndAttach (cyclomatic 27) REDACTED:323— Container.execStartAndAttach has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.NetworkDisconnect (cyclomatic 27) libpod/networking_common.go:397— Container.NetworkDisconnect has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SQLiteState.addContainer (cyclomatic 27) libpod/sqlite_state_internal.go:404— SQLiteState.addContainer has cyclomatic complexity 27 (threshold 15). Of this number, 25 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.
compat.CreateContainer (cyclomatic 27) pkg/api/handlers/compat/containers_create.go:36— compat.CreateContainer 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.
compat.CreateNetwork (cyclomatic 27) pkg/api/handlers/compat/networks.go:295— compat.CreateNetwork 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.
util.ParseIDMapping (cyclomatic 27) REDACTED:960— util.ParseIDMapping 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.
containers.copyFromContainer (cyclomatic 26) cmd/podman/containers/cp.go:205— containers.copyFromContainer has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 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.
containers.copyToContainer (cyclomatic 26) cmd/podman/containers/cp.go:339— containers.copyToContainer has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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.
generate.systemd (cyclomatic 26) cmd/podman/generate/systemd.go:129— generate.systemd 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.
machine.initMachine (cyclomatic 26) cmd/podman/machine/init.go:178— machine.initMachine 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.
BoltState.GetNetworks (cyclomatic 26) libpod/boltdb_state.go:189— BoltState.GetNetworks has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 253, 215). 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.
libpod.ConvertV1PodToYAMLPod (cyclomatic 26) REDACTED:443— libpod.ConvertV1PodToYAMLPod has cyclomatic complexity 26 (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.
Container.getContainerInspectData (cyclomatic 26) libpod/container_inspect.go:64— Container.getContainerInspectData has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
EventLogFile.Read (cyclomatic 26) REDACTED:113— EventLogFile.Read has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 170, 138, 156). 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.
compat.handleBuildContexts (cyclomatic 26) pkg/api/handlers/compat/images_build.go:1187— compat.handleBuildContexts 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.
images.build (cyclomatic 26) REDACTED:1008— images.build has cyclomatic complexity 26 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
infra.ParseIDMapping (cyclomatic 26) pkg/domain/infra/runtime_libpod.go:220— infra.ParseIDMapping has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
specgenutil.setNamespaces (cyclomatic 26) pkg/specgenutil/specgen.go:197— specgenutil.setNamespaces 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.
containers.ps (cyclomatic 25) cmd/podman/containers/ps.go:191— containers.ps 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.
images.imageSearch (cyclomatic 25) cmd/podman/images/search.go:120— images.imageSearch 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.
system.restService (cyclomatic 25) cmd/podman/system/service_abi.go:23— system.restService has cyclomatic complexity 25 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
volumes.prune (cyclomatic 25) cmd/podman/volumes/prune.go:50— volumes.prune 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.
Runtime.mergeDBConfig (cyclomatic 25) libpod/runtime.go:1119— Runtime.mergeDBConfig 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.
bindings.sshClient (cyclomatic 25) REDACTED:178— bindings.sshClient 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.
generate.executePodTemplate (cyclomatic 25) pkg/systemd/generate/pods.go:271— generate.executePodTemplate 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.
quadlet.ConvertVolume (cyclomatic 25) pkg/systemd/quadlet/quadlet.go:1110— quadlet.ConvertVolume 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.
EventJournalD.Read (cyclomatic 25) libpod/events/journal_linux.go:129— EventJournalD.Read has cyclomatic complexity 25 (threshold 15). Of this number, 16 points are the body's own statements and 9 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.
Container.generateInspectContainerHostConfig (cyclomatic 24) libpod/container_inspect.go:490— Container.generateInspectContainerHostConfig 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.
Container.cleanup (cyclomatic 24) libpod/container_internal.go:2226— Container.cleanup 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.
Container.getContainerNetworkInfo (cyclomatic 24) libpod/networking_common.go:215— Container.getContainerNetworkInfo has cyclomatic complexity 24 (threshold 15). Of this number, 22 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.
ContainerEngine.ContainerRun (cyclomatic 24) pkg/domain/infra/abi/containers.go:1180— ContainerEngine.ContainerRun has cyclomatic complexity 24 (threshold 15). Of this number, 23 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.
generate.MakePod (cyclomatic 24) pkg/specgen/generate/pod_create.go:23— generate.MakePod 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.
specgenutil.parseSecrets (cyclomatic 24) pkg/specgenutil/specgen.go:1152— specgenutil.parseSecrets 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.
quadlet.ConvertKube (cyclomatic 24) pkg/systemd/quadlet/quadlet.go:1238— quadlet.ConvertKube 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.
common.DefineCreateFlags (cyclomatic 23) cmd/podman/common/create.go:33— common.DefineCreateFlags 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.
containers.checkpoint (cyclomatic 23) cmd/podman/containers/checkpoint.go:87— containers.checkpoint has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
containers.create (cyclomatic 23) cmd/podman/containers/create.go:120— containers.create 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.
images.imagePush (cyclomatic 23) cmd/podman/images/push.go:158— images.imagePush 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.
manifest.push (cyclomatic 23) cmd/podman/manifest/push.go:111— manifest.push 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.
Container.ExecHTTPStartAndAttach (cyclomatic 23) REDACTED:471— Container.ExecHTTPStartAndAttach has cyclomatic complexity 23 (threshold 15). Of this number, 22 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.
Container.prepareProcessExec (cyclomatic 23) libpod/oci_conmon_exec_common.go:681— Container.prepareProcessExec has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ConmonOCIRuntime.startExec (cyclomatic 23) libpod/oci_conmon_exec_common.go:328— ConmonOCIRuntime.startExec 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.
Runtime.Migrate (cyclomatic 23) libpod/runtime_migrate.go:21— Runtime.Migrate 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.
Runtime.NewPod (cyclomatic 23) libpod/runtime_pod_common.go:18— Runtime.NewPod has cyclomatic complexity 23 (threshold 15). Of this number, 21 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.
compat.StatsContainer (cyclomatic 23) pkg/api/handlers/compat/containers_stats.go:22— compat.StatsContainer 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.
compat.processBuildContext (cyclomatic 23) pkg/api/handlers/compat/images_build.go:268— compat.processBuildContext 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.
filters.GenerateVolumeFilters (cyclomatic 23) pkg/domain/filters/volumes.go:16— filters.GenerateVolumeFilters has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 belong to 2 function literals inside it that branch. 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.
ContainerEngine.SystemDf (cyclomatic 23) pkg/domain/infra/abi/system.go:186— ContainerEngine.SystemDf 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.
generate.getVolumesFrom (cyclomatic 23) pkg/specgen/generate/storage.go:268— generate.getVolumesFrom 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.
kube.ToPodOpt (cyclomatic 23) pkg/specgen/generate/kube/kube.go:58— kube.ToPodOpt 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.
kube.VolumeFromHostPath (cyclomatic 23) pkg/specgen/generate/kube/volume.go:66— kube.VolumeFromHostPath 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.
util.parseTriple (cyclomatic 23) REDACTED:356— util.parseTriple 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.
containers.exec (cyclomatic 22) cmd/podman/containers/exec.go:130— containers.exec 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.
libpod.generateKubeSecurityContext (cyclomatic 22) REDACTED:1372— libpod.generateKubeSecurityContext has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
Container.mountNamedVolume (cyclomatic 22) libpod/container_internal.go:1952— Container.mountNamedVolume has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
Container.cleanupStorage (cyclomatic 22) libpod/container_internal.go:2073— Container.cleanupStorage 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.
ConmonOCIRuntime.Attach (cyclomatic 22) REDACTED:35— ConmonOCIRuntime.Attach has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
Runtime.migrateDB (cyclomatic 22) libpod/runtime_migrate.go:133— Runtime.migrateDB 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.
SQLiteState.RemovePodContainers (cyclomatic 22) libpod/sqlite_state.go:1801— SQLiteState.RemovePodContainers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 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.
compat.ListContainers (cyclomatic 22) pkg/api/handlers/compat/containers.go:106— compat.ListContainers has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
libpod.CommitContainer (cyclomatic 22) pkg/api/handlers/libpod/images.go:486— libpod.CommitContainer has cyclomatic complexity 22 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
libpod.PushImage (cyclomatic 22) pkg/api/handlers/libpod/images_push.go:25— libpod.PushImage has cyclomatic complexity 22 (threshold 15). Of this number, 21 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.
ImageEngine.Push (cyclomatic 22) pkg/domain/infra/abi/images.go:350— ImageEngine.Push 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.
ImageEngine.Sign (cyclomatic 22) pkg/domain/infra/abi/images.go:704— ImageEngine.Sign has cyclomatic complexity 22 (threshold 15). 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 718). 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.
ContainerEngine.ContainerClone (cyclomatic 22) pkg/domain/infra/abi/containers.go:1727— ContainerEngine.ContainerClone 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.
ContainerEngine.SystemPrune (cyclomatic 22) pkg/domain/infra/abi/system.go:69— ContainerEngine.SystemPrune 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.
listLocal.build (cyclomatic 22) pkg/farm/list_builder.go:58— listLocal.build has cyclomatic complexity 22 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ps.GetContainerLists (cyclomatic 22) pkg/ps/ps.go:31— ps.GetContainerLists 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.
ps.ListContainerBatch (cyclomatic 22) pkg/ps/ps.go:171— ps.ListContainerBatch has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 190). 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.
trust.AddPolicyEntries (cyclomatic 22) REDACTED:158— trust.AddPolicyEntries 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.
network.networkCreate (cyclomatic 21) cmd/podman/networks/create.go:99— network.networkCreate 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.
libpod.startNode (cyclomatic 21) libpod/container_graph.go:202— libpod.startNode 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.
libpod.httpAttachNonTerminalCopy (cyclomatic 21) REDACTED:1596— libpod.httpAttachNonTerminalCopy 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.
Container.execLightweight (cyclomatic 21) REDACTED:1207— Container.execLightweight has cyclomatic complexity 21 (threshold 15). Of this number, 19 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.
ConmonOCIRuntime.sharedConmonArgs (cyclomatic 21) REDACTED:1323— ConmonOCIRuntime.sharedConmonArgs 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.
compat.TopContainer (cyclomatic 21) pkg/api/handlers/compat/containers_top.go:19— compat.TopContainer 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.
compat.GetEvents (cyclomatic 21) pkg/api/handlers/compat/events.go:21— compat.GetEvents 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.
abi.getAllQuadlets (cyclomatic 21) pkg/domain/infra/abi/quadlet_utils.go:110— abi.getAllQuadlets 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.
parse.VolumeOptions (cyclomatic 21) pkg/domain/infra/abi/parse/parse.go:18— parse.VolumeOptions 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.
ContainerEngine.containerStopImpl (cyclomatic 21) pkg/domain/infra/abi/containers.go:299— ContainerEngine.containerStopImpl has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 322). 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.
emulation.parseBinfmtMisc (cyclomatic 21) pkg/emulation/binfmtmisc_linux.go:113— emulation.parseBinfmtMisc 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.
Farm.Build (cyclomatic 21) pkg/farm/farm.go:224— Farm.Build has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
generate.DevicesFromPath (cyclomatic 21) pkg/specgen/generate/config_linux.go:27— generate.DevicesFromPath has cyclomatic complexity 21 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
images.imagePull (cyclomatic 20) cmd/podman/images/pull.go:144— images.imagePull 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.
libpod.podmanTopInner (cyclomatic 20) REDACTED:64— libpod.podmanTopInner 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.
Pod.Inspect (cyclomatic 20) libpod/pod_api.go:595— Pod.Inspect 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.
Runtime.RemoveStorageContainer (cyclomatic 20) libpod/runtime_cstorage.go:63— Runtime.RemoveStorageContainer 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.
Volume.mount (cyclomatic 20) libpod/volume_internal_common.go:31— Volume.mount 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.
libpod.ManifestCreate (cyclomatic 20) pkg/api/handlers/libpod/manifests.go:40— libpod.ManifestCreate 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.
libpod.ManifestPush (cyclomatic 20) pkg/api/handlers/libpod/manifests.go:351— libpod.ManifestPush 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.
utils.CompatPull (cyclomatic 20) pkg/api/handlers/utils/images.go:186— utils.CompatPull 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.
ImageEngine.Mount (cyclomatic 20) pkg/domain/infra/abi/images.go:158— ImageEngine.Mount 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.
ImageEngine.ManifestPush (cyclomatic 20) pkg/domain/infra/abi/manifest.go:473— ImageEngine.ManifestPush 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.
ContainerEngine.NetworkRm (cyclomatic 20) pkg/domain/infra/abi/network.go:137— ContainerEngine.NetworkRm 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.
ContainerEngine.playKubePVC (cyclomatic 20) pkg/domain/infra/abi/play.go:1470— ContainerEngine.playKubePVC 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.
quadlet.ConvertBuild (cyclomatic 20) pkg/systemd/quadlet/quadlet.go:1421— quadlet.ConvertBuild 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.
common.AutocompleteFormat (cyclomatic 19) cmd/podman/common/completion.go:1358— common.AutocompleteFormat has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 1360). 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.
containers.pullImage (cyclomatic 19) cmd/podman/containers/create.go:350— containers.pullImage 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.
manifest.add (cyclomatic 19) cmd/podman/manifest/add.go:127— manifest.add 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.
localapi.CheckIfImageBuildPathsOnRunningMachine (cyclomatic 19) internal/localapi/utils.go:164— localapi.CheckIfImageBuildPathsOnRunningMachine 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.
Container.NamespaceMode (cyclomatic 19) libpod/container.go:1504— Container.NamespaceMode 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.
Container.WaitForExit (cyclomatic 19) libpod/container_api.go:618— Container.WaitForExit 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.
Container.init (cyclomatic 19) libpod/container_internal.go:1029— Container.init 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.
Container.resolvePath (cyclomatic 19) libpod/container_path_resolution.go:59— Container.resolvePath 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.
events.newEventFromJournalEntry (cyclomatic 19) libpod/events/journal_linux.go:227— events.newEventFromJournalEntry 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.
Event.toHumanReadable (cyclomatic 19) libpod/events/events.go:46— Event.toHumanReadable has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: events.StringToStatus (cyclomatic 43) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Pod.stopWithTimeout (cyclomatic 19) libpod/pod_api.go:150— Pod.stopWithTimeout 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.
Runtime.refresh (cyclomatic 19) libpod/runtime.go:899— Runtime.refresh 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.
SQLiteState.RenameVolume (cyclomatic 19) libpod/sqlite_state.go:1358— SQLiteState.RenameVolume has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
libpod.KubePlay (cyclomatic 19) pkg/api/handlers/REDACTED:81— libpod.KubePlay 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, 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.
artifacts.Extract (cyclomatic 19) pkg/bindings/artifacts/extract.go:17— artifacts.Extract 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.
MachineConfig.Remove (cyclomatic 19) pkg/machine/vmconfigs/machine.go:147— MachineConfig.Remove has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 187). 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.
specgenutil.MakeHealthCheckFromCli (cyclomatic 19) pkg/specgenutil/specgen.go:1010— specgenutil.MakeHealthCheckFromCli 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.
HyperVStubber.CreateVM (cyclomatic 19) pkg/machine/hyperv/stubber.go:64— HyperVStubber.CreateVM has cyclomatic complexity 19 (threshold 15). Of this number, 16 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.
containers.copyContainerToContainer (cyclomatic 18) cmd/podman/containers/cp.go:126— containers.copyContainerToContainer has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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.
main.loadTemplateInstances (cyclomatic 18) cmd/quadlet/main.go:133— main.loadTemplateInstances 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.
main.transformSwagger (cyclomatic 18) hack/swagger-version-paths/main.go:67— main.transformSwagger 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.
Container.Attach (cyclomatic 18) libpod/container_api.go:178— Container.Attach has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Container.handleRestartPolicy (cyclomatic 18) libpod/container_internal.go:275— Container.handleRestartPolicy has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 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.
Container.restartWithTimeout (cyclomatic 18) libpod/container_internal.go:1681— Container.restartWithTimeout has cyclomatic complexity 18 (threshold 15). Of this number, 16 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.
ConmonOCIRuntime.StopContainer (cyclomatic 18) REDACTED:342— ConmonOCIRuntime.StopContainer has cyclomatic complexity 18 (threshold 15). Of this number, 11 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.
SQLiteState.RemovePod (cyclomatic 18) libpod/sqlite_state.go:1726— SQLiteState.RemovePod has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: 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.
SQLiteState.networkModify (cyclomatic 18) libpod/sqlite_state_internal.go:573— SQLiteState.networkModify 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.
compat.ExecStartHandler (cyclomatic 18) pkg/api/handlers/compat/exec.go:146— compat.ExecStartHandler 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.
updater.updateUnit (cyclomatic 18) pkg/autoupdate/autoupdate.go:158— updater.updateUnit has cyclomatic complexity 18 (threshold 15). Of this number, 14 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.
images.Pull (cyclomatic 18) pkg/bindings/images/pull.go:24— images.Pull 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.
ImageEngine.ManifestAnnotate (cyclomatic 18) pkg/domain/infra/abi/manifest.go:272— ImageEngine.ManifestAnnotate 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.
ContainerEngine.ContainerStats (cyclomatic 18) pkg/domain/infra/abi/containers.go:1624— ContainerEngine.ContainerStats has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1653, 1634). 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.
ContainerEngine.ContainerRunlabel (cyclomatic 18) pkg/domain/infra/abi/containers_runlabel.go:25— ContainerEngine.ContainerRunlabel 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.
ContainerEngine.PodClone (cyclomatic 18) pkg/domain/infra/abi/pods.go:322— ContainerEngine.PodClone 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.
ContainerEngine.ContainerRm (cyclomatic 18) pkg/domain/infra/tunnel/containers.go:243— ContainerEngine.ContainerRm 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.
generate.PodConfigToSpec (cyclomatic 18) pkg/specgen/generate/pod_create.go:273— generate.PodConfigToSpec 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.
quadlet.handleSetWorkingDirectory (cyclomatic 18) pkg/systemd/quadlet/quadlet.go:2060— quadlet.handleSetWorkingDirectory 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.
util.ParseDockerignore (cyclomatic 18) REDACTED:54— util.ParseDockerignore 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.
farm.build (cyclomatic 17) cmd/podman/farm/build.go:67— farm.build 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.
farm.farmUpdate (cyclomatic 17) cmd/podman/farm/update.go:57— farm.farmUpdate 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 one function literal inside it that branches (line 66). 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.
system.printSystemCheckResults (cyclomatic 17) cmd/podman/system/check.go:86— system.printSystemCheckResults 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.
connection.inspect (cyclomatic 17) cmd/podman/system/connection/list.go:75— connection.inspect 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.
registry.StartWithOptions (cyclomatic 17) hack/podman-registry-go/registry.go:46— registry.StartWithOptions 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.
SQLiteState.AddPod (cyclomatic 17) libpod/sqlite_state.go:1656— SQLiteState.AddPod 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, 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.
compat.CreateVolume (cyclomatic 17) pkg/api/handlers/compat/volumes.go:95— compat.CreateVolume 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.
libpod.InstallQuadlets (cyclomatic 17) REDACTED:178— libpod.InstallQuadlets 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.
updater.assembleTasks (cyclomatic 17) pkg/autoupdate/autoupdate.go:356— updater.assembleTasks 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.
containers.Commit (cyclomatic 17) pkg/bindings/containers/commit.go:22— containers.Commit 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.
containers.Logs (cyclomatic 17) pkg/bindings/containers/logs.go:16— containers.Logs 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.
images.Push (cyclomatic 17) pkg/bindings/images/push.go:24— images.Push 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.
manifests.Push (cyclomatic 17) pkg/bindings/manifests/manifests.go:240— manifests.Push 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.
abi.getKubePods (cyclomatic 17) pkg/domain/infra/abi/generate.go:300— abi.getKubePods 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.
ImageEngine.List (cyclomatic 17) pkg/domain/infra/abi/images_list.go:15— ImageEngine.List 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 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.
ImageEngine.remoteManifestInspect (cyclomatic 17) pkg/domain/infra/abi/manifest.go:107— ImageEngine.remoteManifestInspect 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tunnel.getContainersAndInputByContext (cyclomatic 17) pkg/domain/infra/tunnel/helpers.go:23— tunnel.getContainersAndInputByContext 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.
emulation.registeredBinfmtMisc (cyclomatic 17) pkg/emulation/binfmtmisc_linux.go:23— emulation.registeredBinfmtMisc has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 26). 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.
shim.Remove (cyclomatic 17) pkg/machine/shim/host.go:863— shim.Remove 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.
specgen.SetupUserNS (cyclomatic 17) pkg/specgen/namespaces.go:482— specgen.SetupUserNS 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.
generate.applyHealthCheckOverrides (cyclomatic 17) pkg/specgen/generate/container.go:66— generate.applyHealthCheckOverrides 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.
NotifyProxy.listen (cyclomatic 17) pkg/systemd/notifyproxy/notifyproxy.go:116— NotifyProxy.listen has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 117). 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.
parser.escapeString (cyclomatic 17) pkg/systemd/parser/split.go:455— parser.escapeString 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.
quadlet.handleUserRemap (cyclomatic 17) pkg/systemd/quadlet/quadlet.go:1794— quadlet.handleUserRemap 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.
util.breakInsert (cyclomatic 17) REDACTED:437— util.breakInsert 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.
HyperVStubber.SetProviderAttrs (cyclomatic 17) pkg/machine/hyperv/stubber.go:700— HyperVStubber.SetProviderAttrs has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
vsock.loadHVSockRegistryEntries (cyclomatic 17) pkg/machine/hyperv/vsock/vsock.go:351— vsock.loadHVSockRegistryEntries has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
containers.portsToString (cyclomatic 16) cmd/podman/containers/ps.go:494— containers.portsToString has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
containers.validateStart (cyclomatic 16) cmd/podman/containers/start.go:85— containers.validateStart 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.
containers.GetChangedHealthCheckConfiguration (cyclomatic 16) cmd/podman/containers/update.go:70— containers.GetChangedHealthCheckConfiguration 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.
containers.update (cyclomatic 16) cmd/podman/containers/update.go:132— containers.update 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.
system.prune (cyclomatic 16) cmd/podman/system/prune.go:57— system.prune has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
main.loadUnitDropins (cyclomatic 16) cmd/quadlet/main.go:193— main.loadUnitDropins has cyclomatic complexity 16 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
libpod.detectCycles (cyclomatic 16) libpod/container_graph.go:104— libpod.detectCycles 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 117). 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.
Container.exec (cyclomatic 16) REDACTED:829— Container.exec has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
Container.stopInternal (cyclomatic 16) libpod/container_internal.go:1440— Container.stopInternal 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.
Container.prepare (cyclomatic 16) libpod/container_internal_linux.go:61— Container.prepare 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logs.getTailLog (cyclomatic 16) libpod/logs/log.go:86— logs.getTailLog 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.
Runtime.RenumberLocks (cyclomatic 16) libpod/runtime_renumber.go:14— Runtime.RenumberLocks 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.
Runtime.UpdateVolumePlugins (cyclomatic 16) libpod/runtime_volume_common.go:262— Runtime.UpdateVolumePlugins 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.
SQLiteState.AllContainers (cyclomatic 16) libpod/sqlite_state.go:829— SQLiteState.AllContainers 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.
SQLiteState.AddVolume (cyclomatic 16) libpod/sqlite_state.go:2000— SQLiteState.AddVolume 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, 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.
compat.AttachContainer (cyclomatic 16) pkg/api/handlers/compat/containers_attach.go:16— compat.AttachContainer 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.
compat.SearchImages (cyclomatic 16) pkg/api/handlers/compat/images_search.go:21— compat.SearchImages 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.
libpod.PodTop (cyclomatic 16) pkg/api/handlers/libpod/pods.go:387— libpod.PodTop 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.
Connection.DoRequest (cyclomatic 16) REDACTED:426— Connection.DoRequest 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.
util.ToParams (cyclomatic 16) pkg/bindings/internal/util/util.go:54— util.ToParams 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.
ContainerEngine.KubeApply (cyclomatic 16) REDACTED:22— ContainerEngine.KubeApply 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.
ContainerEngine.ContainerCleanup (cyclomatic 16) pkg/domain/infra/abi/containers.go:1344— ContainerEngine.ContainerCleanup 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.
ContainerEngine.ContainerUnmount (cyclomatic 16) pkg/domain/infra/abi/containers.go:1526— ContainerEngine.ContainerUnmount 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.
ContainerEngine.installQuadlet (cyclomatic 16) pkg/domain/infra/abi/quadlet.go:303— ContainerEngine.installQuadlet 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.
ContainerEngine.ContainerRestore (cyclomatic 16) pkg/domain/infra/tunnel/containers.go:458— ContainerEngine.ContainerRestore 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.
ContainerEngine.ContainerRun (cyclomatic 16) pkg/domain/infra/tunnel/containers.go:896— ContainerEngine.ContainerRun 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.
Farm.Schedule (cyclomatic 16) pkg/farm/farm.go:149— Farm.Schedule has cyclomatic complexity 16 (threshold 15). Of this number, 10 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.
shim.Reset (cyclomatic 16) pkg/machine/shim/host.go:950— shim.Reset 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.
generate.createPodOptions (cyclomatic 16) pkg/specgen/generate/pod_create.go:117— generate.createPodOptions 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.
specgenutil.getIOLimits (cyclomatic 16) pkg/specgenutil/specgen.go:77— specgenutil.getIOLimits 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.
generate.PodUnits (cyclomatic 16) pkg/systemd/generate/pods.go:134— generate.PodUnits 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.
util.parseAutoTriple (cyclomatic 16) REDACTED:818— util.parseAutoTriple 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.
EventJournalD.Write (cyclomatic 16) libpod/events/journal_linux.go:31— EventJournalD.Write has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D12 · Dependency Hygiene· Dependency pinned to a stale untagged commit · ×1
Dependency pinned to a stale untagged commit: github.com/google/shlex — Direct dependency `github.com/google/shlex` is required at `v0.0.0-20191202100458-e7afc7fbc510` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2019-12-02, 6.9 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/google/shlex` and has not moved this requirement in 6.9 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/google/shlex` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
Repeated repair: libpod/define/container_inspect.go libpod/define/container_inspect.go:112— libpod/define/container_inspect.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 InspectContainerConfig.UnmarshalJSON at line 112), 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: implement console size for container inspect in linux”; “swagger: fix deprecated alias annotations and model name collisions”; “Add dnsnames field & fix alias field”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-25..2026-10-23, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-25 12:14:25 +02:00' --until='2026-10-23 12:14:25 +02:00' --full-history --no-merges -- libpod/define/container_inspect.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.
Container.generateSpec (cognitive 329) REDACTED:235— Container.generateSpec has cognitive complexity 329 (threshold 15). Drivers by points: if/else 122 (282 pts), loops 18 (30 pts), boolean chains 12, match/switch 2 (5 pts) (nesting depth added 175). Of this number, 327 points are the body's own statements and 2 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.
specgenutil.FillOutSpecGen (cognitive 233) pkg/specgenutil/specgen.go:334— specgenutil.FillOutSpecGen has cognitive complexity 233 (threshold 15). Drivers by points: if/else 135 (178 pts), boolean chains 42, loops 8 (9 pts), match/switch 2 (4 pts) (nesting depth added 46). 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.
ContainerEngine.playKubePod (cognitive 231) pkg/domain/infra/abi/play.go:730— ContainerEngine.playKubePod has cognitive complexity 231 (threshold 15). Drivers by points: if/else 100 (186 pts), loops 20 (36 pts), boolean chains 8, match/switch 1 (nesting depth added 102). Of this number, 228 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.
Runtime.setupContainer (cognitive 208) libpod/runtime_ctr.go:245— Runtime.setupContainer has cognitive complexity 208 (threshold 15). Drivers by points: if/else 74 (167 pts), loops 9 (25 pts), boolean chains 9, match/switch 3 (7 pts) (nesting depth added 113). Of this number, 202 points are the body's own statements and 6 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.
Container.restore (cognitive 188) REDACTED:1625— Container.restore has cognitive complexity 188 (threshold 15). Drivers by points: if/else 81 (158 pts), loops 7 (18 pts), boolean chains 12 (nesting depth added 88). Of this number, 181 points are the body's own statements and 7 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.
ContainerEngine.PlayKube (cognitive 167) pkg/domain/infra/abi/play.go:237— ContainerEngine.PlayKube has cognitive complexity 167 (threshold 15). Drivers by points: if/else 53 (141 pts), loops 6 (14 pts), match/switch 3 (7 pts), boolean chains 5 (nesting depth added 100). Of this number, 149 points are the body's own statements and 18 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.
compat.cliOpts (cognitive 166) pkg/api/handlers/compat/containers_create.go:214— compat.cliOpts has cognitive complexity 166 (threshold 15). Drivers by points: if/else 56 (121 pts), loops 19 (26 pts), match/switch 4 (10 pts), boolean chains 9 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
filters.GenerateContainerFilterFuncs (cognitive 159) pkg/domain/filters/containers.go:51— filters.GenerateContainerFilterFuncs has cognitive complexity 159 (threshold 15). Drivers by points: if/else 36 (110 pts), loops 16 (35 pts), boolean chains 13, match/switch 1 (nesting depth added 93). Of this number, 59 points are the body's own statements and 100 belong to 9 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.
images.prepareParams (cognitive 146) REDACTED:135— images.prepareParams has cognitive complexity 146 (threshold 15). Drivers by points: if/else 96 (124 pts), loops 13 (16 pts), match/switch 5, boolean chains 1 (nesting depth added 31). 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.
Runtime.removeContainer (cognitive 145) libpod/runtime_ctr.go:705— Runtime.removeContainer has cognitive complexity 145 (threshold 15). Drivers by points: if/else 61 (124 pts), boolean chains 13, loops 4 (8 pts) (nesting depth added 67). Of this number, 141 points are the body's own statements and 4 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.
generate.namespaceOptions (cognitive 145) pkg/specgen/generate/namespaces.go:124— generate.namespaceOptions has cognitive complexity 145 (threshold 15). Drivers by points: if/else 61 (108 pts), boolean chains 16, loops 5 (15 pts), match/switch 6 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kube.ToSpecGen (cognitive 144) pkg/specgen/generate/kube/kube.go:209— kube.ToSpecGen has cognitive complexity 144 (threshold 15). Drivers by points: if/else 77 (124 pts), loops 6 (9 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.extractFirstWord (cognitive 137) pkg/systemd/parser/split.go:219— parser.extractFirstWord has cognitive complexity 137 (threshold 15). Drivers by points: if/else 21 (82 pts), jumps 17, match/switch 5 (16 pts), loops 5 (14 pts), boolean chains 8 (nesting depth added 81). Of this number, 136 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.
generate.MakeContainer (cognitive 134) pkg/specgen/generate/container_create.go:33— generate.MakeContainer has cognitive complexity 134 (threshold 15). Drivers by points: if/else 72 (118 pts), boolean chains 8, match/switch 2 (6 pts), loops 1 (2 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate.createContainerOptions (cognitive 134) pkg/specgen/generate/container_create.go:383— generate.createContainerOptions has cognitive complexity 134 (threshold 15). Drivers by points: if/else 73 (105 pts), loops 10 (16 pts), boolean chains 12, match/switch 1 (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.
common.buildFlagsWrapperToOptions (cognitive 132) cmd/podman/common/build.go:316— common.buildFlagsWrapperToOptions has cognitive complexity 132 (threshold 15). Drivers by points: if/else 77 (112 pts), loops 7 (12 pts), boolean chains 7, match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.NetFlagsToNetOptions (cognitive 130) cmd/podman/common/netflags.go:109— common.NetFlagsToNetOptions has cognitive complexity 130 (threshold 15). Drivers by points: if/else 45 (105 pts), loops 7 (18 pts), boolean chains 7 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgenutil.parseMountOptions (cognitive 127) pkg/specgenutil/volumes.go:317— specgenutil.parseMountOptions has cognitive complexity 127 (threshold 15). Drivers by points: if/else 39 (113 pts), match/switch 4 (12 pts), boolean chains 1, loops 1 (nesting depth added 82). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.createBuildOptions (cognitive 126) pkg/api/handlers/compat/images_build.go:406— compat.createBuildOptions has cognitive complexity 126 (threshold 15). Drivers by points: if/else 70 (106 pts), loops 6 (11 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 44). Of this number, 122 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.
Container.makeBindMounts (cognitive 125) REDACTED:2069— Container.makeBindMounts has cognitive complexity 125 (threshold 15). Drivers by points: if/else 44 (106 pts), boolean chains 9, loops 3 (5 pts), match/switch 1 (3 pts), jumps 2 (nesting depth added 66). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
libpod.makeRuntime (cognitive 124) libpod/runtime.go:330— libpod.makeRuntime has cognitive complexity 124 (threshold 15). Drivers by points: if/else 65 (117 pts), boolean chains 6, loops 1 (nesting depth added 52). Of this number, 108 points are the body's own statements and 16 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate.ParsePortMapping (cognitive 108) pkg/specgen/generate/ports.go:148— generate.ParsePortMapping has cognitive complexity 108 (threshold 15). Drivers by points: if/else 30 (86 pts), loops 9 (20 pts), boolean chains 2 (nesting depth added 67). Of this number, 99 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.
util.processOptionsInternal (cognitive 105) pkg/util/mount_opts.go:36— util.processOptionsInternal has cognitive complexity 105 (threshold 15). Drivers by points: if/else 39 (97 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
filters.GenerateExternalContainerFilterFuncs (cognitive 102) pkg/domain/filters/containers.go:367— filters.GenerateExternalContainerFilterFuncs has cognitive complexity 102 (threshold 15). Drivers by points: if/else 24 (72 pts), loops 11 (24 pts), boolean chains 5, match/switch 1 (nesting depth added 61). Of this number, 62 points are the body's own statements and 40 belong to 6 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.
generate.CompleteSpec (cognitive 98) pkg/specgen/generate/container.go:143— generate.CompleteSpec has cognitive complexity 98 (threshold 15). Drivers by points: if/else 47 (80 pts), loops 6 (10 pts), boolean chains 8 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.newVolume (cognitive 93) libpod/runtime_volume_common.go:48— Runtime.newVolume has cognitive complexity 93 (threshold 15). Drivers by points: if/else 38 (76 pts), match/switch 3 (8 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 45). Of this number, 85 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.
Container.validate (cognitive 92) libpod/container_validate.go:19— Container.validate has cognitive complexity 92 (threshold 15). Drivers by points: if/else 37 (63 pts), boolean chains 21, loops 6 (8 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
containers.Attach (cognitive 92) REDACTED:40— containers.Attach has cognitive complexity 92 (threshold 15). Drivers by points: if/else 36 (77 pts), match/switch 2 (6 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 47). Of this number, 85 points are the body's own statements and 7 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.
Container.mountStorage (cognitive 90) libpod/container_internal.go:1749— Container.mountStorage has cognitive complexity 90 (threshold 15). Drivers by points: if/else 44 (84 pts), boolean chains 5, loops 1 (nesting depth added 40). Of this number, 69 points are the body's own statements and 21 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgen.GenVolumeMounts (cognitive 89) pkg/specgen/volumes.go:89— specgen.GenVolumeMounts has cognitive complexity 89 (threshold 15). Drivers by points: if/else 23 (66 pts), match/switch 2 (9 pts), loops 3 (8 pts), boolean chains 6 (nesting depth added 55). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
main.persistentPreRunE (cognitive 88) cmd/podman/root.go:270— main.persistentPreRunE has cognitive complexity 88 (threshold 15). Drivers by points: if/else 35 (82 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 49). 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.
libpod.simplePodWithV1Containers (cognitive 86) REDACTED:742— libpod.simplePodWithV1Containers has cognitive complexity 86 (threshold 15). Drivers by points: if/else 25 (66 pts), loops 6 (16 pts), boolean chains 4 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.ManifestModify (cognitive 86) pkg/api/handlers/libpod/manifests.go:494— libpod.ManifestModify has cognitive complexity 86 (threshold 15). Drivers by points: if/else 38 (76 pts), loops 3 (6 pts), boolean chains 2, match/switch 2 (nesting depth added 41). Of this number, 58 points are the body's own statements and 28 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.
images.nTar (cognitive 83) REDACTED:1133— images.nTar has cognitive complexity 83 (threshold 15). Drivers by points: if/else 30 (79 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 50). Most of this is not in the body itself: 2 of the 83 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1148, 1297). 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.
specgenutil.mounts (cognitive 82) pkg/specgenutil/volumes.go:191— specgenutil.mounts has cognitive complexity 82 (threshold 15). Drivers by points: if/else 24 (76 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 55). Most of this is not in the body itself: 2 of the 82 points are its own statements and the rest belongs to one function literal inside it that branches (line 196). 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.
generate.executeContainerTemplate (cognitive 82) pkg/systemd/generate/containers.go:287— generate.executeContainerTemplate has cognitive complexity 82 (threshold 15). Drivers by points: if/else 36 (71 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.Reset (cognitive 81) libpod/reset.go:95— Runtime.Reset has cognitive complexity 81 (threshold 15). Drivers by points: if/else 40 (69 pts), loops 6 (10 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.WaitForConditionWithInterval (cognitive 79) libpod/container_api.go:741— Container.WaitForConditionWithInterval has cognitive complexity 79 (threshold 15). Drivers by points: if/else 19 (62 pts), match/switch 5 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 49). Of this number, 18 points are the body's own statements and 61 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.
ContainerEngine.GenerateKube (cognitive 79) pkg/domain/infra/abi/generate.go:113— ContainerEngine.GenerateKube has cognitive complexity 79 (threshold 15). Drivers by points: if/else 34 (73 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConmonOCIRuntime.createOCIContainer (cognitive 77) REDACTED:1018— ConmonOCIRuntime.createOCIContainer has cognitive complexity 77 (threshold 15). Drivers by points: if/else 48 (69 pts), boolean chains 6, loops 2 (nesting depth added 21). Of this number, 75 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.
generate.ConfigToSpec (cognitive 77) pkg/specgen/generate/container.go:382— generate.ConfigToSpec has cognitive complexity 77 (threshold 15). Drivers by points: if/else 28 (40 pts), loops 9 (24 pts), match/switch 3 (11 pts), boolean chains 2 (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.
filters.GeneratePodFilterFunc (cognitive 75) pkg/domain/filters/pods.go:21— filters.GeneratePodFilterFunc has cognitive complexity 75 (threshold 15). Drivers by points: if/else 19 (51 pts), loops 9 (19 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 44). Of this number, 20 points are the body's own statements and 55 belong to 7 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.
common.ParseBuildOpts (cognitive 74) cmd/podman/common/build.go:147— common.ParseBuildOpts has cognitive complexity 74 (threshold 15). Drivers by points: if/else 37 (63 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 28). Of this number, 69 points are the body's own statements and 5 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.
libpod.GetLimits (cognitive 74) libpod/oci_conmon_linux.go:234— libpod.GetLimits has cognitive complexity 74 (threshold 15). Drivers by points: if/else 27 (51 pts), loops 9 (20 pts), match/switch 1 (2 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.
containers.CreateInit (cognitive 73) cmd/podman/containers/create.go:234— containers.CreateInit has cognitive complexity 73 (threshold 15). Drivers by points: if/else 31 (57 pts), boolean chains 13, loops 1 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
checkpoint.CRImportCheckpoint (cognitive 73) pkg/checkpoint/checkpoint_restore.go:47— checkpoint.CRImportCheckpoint has cognitive complexity 73 (threshold 15). Drivers by points: if/else 35 (64 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rootless.becomeRootInUserNS (cognitive 73) REDACTED:216— rootless.becomeRootInUserNS has cognitive complexity 73 (threshold 15). Drivers by points: if/else 33 (58 pts), loops 2 (8 pts), boolean chains 7 (nesting depth added 31). Of this number, 64 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.
Pod.podWithContainers (cognitive 72) REDACTED:569— Pod.podWithContainers has cognitive complexity 72 (threshold 15). Drivers by points: if/else 18 (55 pts), loops 5 (11 pts), boolean chains 6 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.PushImage (cognitive 72) pkg/api/handlers/compat/images_push.go:28— compat.PushImage has cognitive complexity 72 (threshold 15). Drivers by points: if/else 30 (63 pts), match/switch 2 (5 pts), jumps 3, loops 1 (nesting depth added 36). Of this number, 68 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.
generate.finalizeMounts (cognitive 71) pkg/specgen/generate/storage.go:28— generate.finalizeMounts has cognitive complexity 71 (threshold 15). Drivers by points: if/else 28 (53 pts), loops 16, 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.
quadlet.ConvertContainer (cognitive 71) pkg/systemd/quadlet/quadlet.go:605— quadlet.ConvertContainer has cognitive complexity 71 (threshold 15). Drivers by points: if/else 38 (46 pts), boolean chains 13, loops 10, match/switch 1 (2 pts) (nesting depth added 9). 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.
Container.copyFromArchive (cognitive 70) libpod/container_copy_common.go:27— Container.copyFromArchive has cognitive complexity 70 (threshold 15). Drivers by points: if/else 27 (60 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 38). Of this number, 29 points are the body's own statements and 41 belong to 4 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.
Container.generatePasswdAndGroup (cognitive 70) REDACTED:2910— Container.generatePasswdAndGroup has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (58 pts), boolean chains 8, match/switch 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConmonOCIRuntime.HTTPAttach (cognitive 69) REDACTED:482— ConmonOCIRuntime.HTTPAttach has cognitive complexity 69 (threshold 15). Drivers by points: if/else 30 (59 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 34). Of this number, 33 points are the body's own statements and 36 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.
shim.startLocked (cognitive 69) pkg/machine/shim/host.go:558— shim.startLocked has cognitive complexity 69 (threshold 15). Drivers by points: if/else 45 (64 pts), boolean chains 5 (nesting depth added 19). Of this number, 66 points are the body's own statements and 3 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.
containers.ExecStartAndAttach (cognitive 68) REDACTED:410— containers.ExecStartAndAttach has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (61 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 37). Of this number, 63 points are the body's own statements and 5 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.
Container.fixVolumePermissionsUnlocked (cognitive 67) REDACTED:3098— Container.fixVolumePermissionsUnlocked has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (61 pts), boolean chains 6 (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ContainerEngine.PlayKubeDown (cognitive 66) pkg/domain/infra/abi/play.go:1821— ContainerEngine.PlayKubeDown has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (48 pts), loops 5 (11 pts), match/switch 2 (6 pts), boolean chains 1 (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.
images.prepareRemoteRequestBody (cognitive 65) REDACTED:701— images.prepareRemoteRequestBody has cognitive complexity 65 (threshold 15). Drivers by points: if/else 27 (57 pts), loops 5 (6 pts), match/switch 1 (2 pts) (nesting depth added 32). Of this number, 41 points are the body's own statements and 24 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.
utils.ExecuteTransfer (cognitive 64) pkg/domain/utils/scp.go:21— utils.ExecuteTransfer has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (57 pts), match/switch 3 (4 pts), loops 2, boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.containerToV1Container (cognitive 63) REDACTED:909— libpod.containerToV1Container has cognitive complexity 63 (threshold 15). Drivers by points: if/else 29 (50 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.QuadletRemove (cognitive 63) pkg/domain/infra/abi/quadlet.go:577— ContainerEngine.QuadletRemove has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (52 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.readFromJournal (cognitive 62) libpod/container_log_unsupported.go:13— Container.readFromJournal has cognitive complexity 62 (threshold 15). Drivers by points: if/else 29 (47 pts), boolean chains 7, loops 4 (5 pts), match/switch 1 (3 pts) (nesting depth added 21). Of this number, 25 points are the body's own statements and 37 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.
abi.getContainers (cognitive 62) pkg/domain/infra/abi/containers.go:59— abi.getContainers has cognitive complexity 62 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 7 (16 pts), boolean chains 4, match/switch 1 (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.
generate.getVolumesFrom (cognitive 61) pkg/specgen/generate/storage.go:268— generate.getVolumesFrom has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (45 pts), loops 6 (12 pts), match/switch 1 (4 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.ImagesPull (cognitive 60) pkg/api/handlers/libpod/images_pull.go:33— libpod.ImagesPull has cognitive complexity 60 (threshold 15). Drivers by points: if/else 28 (45 pts), loops 4 (8 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 22). Of this number, 51 points are the body's own statements and 9 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.
bindings.sshClient (cognitive 60) REDACTED:178— bindings.sshClient has cognitive complexity 60 (threshold 15). Drivers by points: if/else 24 (59 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.
compat.TopContainer (cognitive 59) pkg/api/handlers/compat/containers_top.go:19— compat.TopContainer has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (42 pts), loops 3 (9 pts), jumps 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 31). Of this number, 58 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.processBuildContext (cognitive 59) pkg/api/handlers/compat/images_build.go:268— compat.processBuildContext has cognitive complexity 59 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 32). 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.
parse.VolumeOptions (cognitive 59) pkg/domain/infra/abi/parse/parse.go:18— parse.VolumeOptions has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (49 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.LibpodToContainer (cognitive 58) pkg/api/handlers/compat/containers.go:326— compat.LibpodToContainer has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (48 pts), match/switch 3 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.handleBuildContexts (cognitive 57) pkg/api/handlers/compat/images_build.go:1187— compat.handleBuildContexts has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (55 pts), loops 2 (nesting depth added 31). Of this number, 45 points are the body's own statements and 12 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.
libpod.httpAttachNonTerminalCopy (cognitive 56) REDACTED:1596— libpod.httpAttachNonTerminalCopy has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (52 pts), match/switch 1 (3 pts), loops 1 (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.
Runtime.removeVolume (cognitive 56) libpod/runtime_volume_common.go:370— Runtime.removeVolume has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (51 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kube.setupSecurityContext (cognitive 56) pkg/specgen/generate/kube/kube.go:974— kube.setupSecurityContext has cognitive complexity 56 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 6, loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
containers.run (cognitive 54) cmd/podman/containers/run.go:105— containers.run has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (42 pts), loops 4 (6 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kube.play (cognitive 53) cmd/podman/kube/play.go:234— kube.play has cognitive complexity 53 (threshold 15). Drivers by points: if/else 30 (45 pts), boolean chains 6, loops 2 (nesting depth added 15). 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.
Container.Commit (cognitive 53) libpod/container_commit.go:39— Container.Commit has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (39 pts), loops 7 (11 pts), boolean chains 3 (nesting depth added 20). Of this number, 51 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.
BoltState.GetNetworks (cognitive 52) libpod/boltdb_state.go:189— BoltState.GetNetworks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (50 pts), loops 1 (2 pts) (nesting depth added 25). Most of this is not in the body itself: 8 of the 52 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 253, 215). 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.
quadlet.ConvertVolume (cognitive 52) pkg/systemd/quadlet/quadlet.go:1110— quadlet.ConvertVolume has cognitive complexity 52 (threshold 15). Drivers by points: if/else 24 (49 pts), boolean chains 3 (nesting depth added 25). 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.
SpecGenerator.Validate (cognitive 51) pkg/specgen/container_validate.go:27— SpecGenerator.Validate has cognitive complexity 51 (threshold 15). Drivers by points: if/else 27 (34 pts), boolean chains 17 (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.
specgenutil.parseVolumes (cognitive 51) pkg/specgenutil/volumes.go:53— specgenutil.parseVolumes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 13, boolean chains 2 (nesting depth added 18). Of this number, 50 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.
Container.update (cognitive 50) libpod/container_internal.go:2840— Container.update has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (43 pts), boolean chains 5, 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.
Container.resolvePath (cognitive 50) libpod/container_path_resolution.go:59— Container.resolvePath has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (49 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageEngine.Sign (cognitive 50) pkg/domain/infra/abi/images.go:704— ImageEngine.Sign has cognitive complexity 50 (threshold 15). Drivers by points: if/else 20 (46 pts), loops 2 (4 pts) (nesting depth added 28). Most of this is not in the body itself: 5 of the 50 points are its own statements and the rest belongs to one function literal inside it that branches (line 718). 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.
inspector.inspect (cognitive 49) cmd/podman/inspect/inspect.go:78— inspector.inspect has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 7 (15 pts), boolean chains 2, match/switch 2 (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.
libpod.PodTop (cognitive 49) pkg/api/handlers/libpod/pods.go:387— libpod.PodTop has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 4 (14 pts), jumps 3, match/switch 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.QuadletInstall (cognitive 49) pkg/domain/infra/abi/quadlet.go:29— ContainerEngine.QuadletInstall has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (37 pts), loops 5 (7 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
system.restService (cognitive 48) cmd/podman/system/service_abi.go:23— system.restService has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (44 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 23). Of this number, 47 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.
Container.cleanup (cognitive 48) libpod/container_internal.go:2226— Container.cleanup has cognitive complexity 48 (threshold 15). Drivers by points: if/else 24 (45 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.
Container.exportCheckpoint (cognitive 48) REDACTED:1184— Container.exportCheckpoint has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (44 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). Of this number, 33 points are the body's own statements and 15 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.
manifests.Modify (cognitive 48) pkg/bindings/manifests/manifests.go:316— manifests.Modify has cognitive complexity 48 (threshold 15). Drivers by points: if/else 25 (41 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 18). Of this number, 24 points are the body's own statements and 24 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.
shim.Init (cognitive 48) pkg/machine/shim/host.go:72— shim.Init has cognitive complexity 48 (threshold 15). Drivers by points: if/else 35 (46 pts), loops 1, match/switch 1 (nesting depth added 11). Of this number, 44 points are the body's own statements and 4 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.
specgenutil.parseSecrets (cognitive 48) pkg/specgenutil/specgen.go:1152— specgenutil.parseSecrets has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 2 (3 pts), match/switch 1 (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.
compat.LogsFromContainer (cognitive 47) pkg/api/handlers/compat/containers_logs.go:23— compat.LogsFromContainer has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 20). Of this number, 46 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.
compat.CreateNetwork (cognitive 47) pkg/api/handlers/compat/networks.go:295— compat.CreateNetwork has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.CompatPull (cognitive 47) pkg/api/handlers/utils/images.go:186— utils.CompatPull has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 2 (5 pts), boolean chains 1, jumps 1, loops 1 (nesting depth added 28). Of this number, 45 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.
infra.getRuntime (cognitive 47) pkg/domain/infra/runtime_libpod.go:56— infra.getRuntime has cognitive complexity 47 (threshold 15). Drivers by points: if/else 33 (39 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
containers.port (cognitive 46) cmd/podman/containers/port.go:68— containers.port has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 4 (11 pts), boolean chains 7 (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.
compat.LibpodToContainerJSON (cognitive 46) pkg/api/handlers/compat/containers.go:513— compat.LibpodToContainerJSON has cognitive complexity 46 (threshold 15). Drivers by points: if/else 26 (37 pts), loops 2 (5 pts), boolean chains 2, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.NetworkRm (cognitive 46) pkg/domain/infra/abi/network.go:137— ContainerEngine.NetworkRm has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (39 pts), boolean chains 4, loops 2 (3 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.
parser.cUnescapeOne (cognitive 46) pkg/systemd/parser/split.go:57— parser.cUnescapeOne has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 4, loops 2 (4 pts), match/switch 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.
containers.restore (cognitive 45) cmd/podman/containers/restore.go:93— containers.restore has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 13, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
abi.getAllQuadlets (cognitive 45) pkg/domain/infra/abi/quadlet_utils.go:110— abi.getAllQuadlets has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 6 (10 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.removePod (cognitive 44) libpod/runtime_pod_common.go:191— Runtime.removePod has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 3, 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.
SQLiteState.Refresh (cognitive 44) libpod/sqlite_state.go:119— SQLiteState.Refresh has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (38 pts), loops 6 (nesting depth added 13). Of this number, 41 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.
specgen.ParseNetworkFlag (cognitive 44) pkg/specgen/namespaces.go:317— specgen.ParseNetworkFlag has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (35 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PodSpecGenerator.Validate (cognitive 44) pkg/specgen/pod_validate.go:18— PodSpecGenerator.Validate has cognitive complexity 44 (threshold 15). Drivers by points: if/else 24 (42 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
volumes.prune (cognitive 43) cmd/podman/volumes/prune.go:50— volumes.prune has cognitive complexity 43 (threshold 15). Drivers by points: if/else 22 (37 pts), boolean chains 4, 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.
events.generateEventFilter (cognitive 43) libpod/events/filters.go:13— events.generateEventFilter has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 22). Most of this is not in the body itself: 3 of the 43 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 93, 63, 16, …). 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.
compat.StatsContainer (cognitive 43) pkg/api/handlers/compat/containers_stats.go:22— compat.StatsContainer has cognitive complexity 43 (threshold 15). Drivers by points: if/else 23 (39 pts), boolean chains 2, jumps 1, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgenutil.setNamespaces (cognitive 43) pkg/specgenutil/specgen.go:197— specgenutil.setNamespaces has cognitive complexity 43 (threshold 15). Drivers by points: if/else 24 (40 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.
libpod.requestMachinePorts (cognitive 42) libpod/networking_machine.go:34— libpod.requestMachinePorts has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (36 pts), loops 3 (6 pts) (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.
Container.runHealthCheck (cognitive 42) libpod/healthcheck.go:54— Container.runHealthCheck has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.getContainerNetworkInfo (cognitive 42) libpod/networking_common.go:215— Container.getContainerNetworkInfo has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (33 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 16). Of this number, 40 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.
ContainerEngine.ContainerMount (cognitive 42) pkg/domain/infra/abi/containers.go:1417— ContainerEngine.ContainerMount has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 5, loops 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.SystemDf (cognitive 42) pkg/domain/infra/abi/system.go:186— ContainerEngine.SystemDf has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 3, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate.SpecGenToOCI (cognitive 42) pkg/specgen/generate/oci_linux.go:103— generate.SpecGenToOCI has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 5 (8 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 11). 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.
kube.VolumeFromHostPath (cognitive 42) pkg/specgen/generate/kube/volume.go:66— kube.VolumeFromHostPath has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 1 (2 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.
util.ParseDockerignore (cognitive 42) REDACTED:54— util.ParseDockerignore has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (36 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 25). 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.
Container.generateInspectContainerHostConfig (cognitive 41) libpod/container_inspect.go:490— Container.generateInspectContainerHostConfig has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (36 pts), loops 4 (5 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.
Container.checkpoint (cognitive 41) REDACTED:1393— Container.checkpoint has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26 (35 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 10). Of this number, 38 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.
Runtime.evictContainer (cognitive 41) libpod/runtime_ctr.go:1078— Runtime.evictContainer has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (38 pts), loops 2, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLiteState.ValidateDBConfig (cognitive 41) libpod/sqlite_state.go:304— SQLiteState.ValidateDBConfig has cognitive complexity 41 (threshold 15). Drivers by points: if/else 29 (41 pts) (nesting depth added 12). Of this number, 26 points are the body's own statements and 15 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.
ContainerEngine.ContainerStart (cognitive 41) pkg/domain/infra/abi/containers.go:1036— ContainerEngine.ContainerStart has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (39 pts), boolean chains 1, loops 1 (nesting depth added 25). Of this number, 39 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.
Container.setupStorage (cognitive 40) libpod/container_internal.go:451— Container.setupStorage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.NetworkDisconnect (cognitive 40) libpod/networking_common.go:397— Container.NetworkDisconnect has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (35 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.SystemCheck (cognitive 40) libpod/runtime.go:1392— Runtime.SystemCheck has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (30 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 15). Of this number, 36 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.
kube.ToPodOpt (cognitive 40) pkg/specgen/generate/kube/kube.go:58— kube.ToPodOpt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 5 (14 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.
generate.executePodTemplate (cognitive 40) pkg/systemd/generate/pods.go:271— generate.executePodTemplate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 1 (3 pts), boolean chains 2, match/switch 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.
containers.ps (cognitive 39) cmd/podman/containers/ps.go:191— containers.ps has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 4 (7 pts), boolean chains 2, match/switch 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.loadTemplateInstances (cognitive 39) cmd/quadlet/main.go:133— main.loadTemplateInstances has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 3 (4 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.
generate.DevicesFromPath (cognitive 39) pkg/specgen/generate/config_linux.go:27— generate.DevicesFromPath has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 2 (nesting depth added 18). Of this number, 31 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.
NotifyProxy.listen (cognitive 39) pkg/systemd/notifyproxy/notifyproxy.go:116— NotifyProxy.listen has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 4 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 24). None of this is in the body itself: all 39 points belong to one function literal inside it that branches (line 117). 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.
libpod.attachExecHTTP (cognitive 38) libpod/oci_conmon_exec_common.go:493— libpod.attachExecHTTP has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (34 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). Of this number, 26 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerRun (cognitive 38) pkg/domain/infra/abi/containers.go:1180— ContainerEngine.ContainerRun has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 3, loops 1 (nesting depth added 14). Of this number, 37 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.
machine.initMachine (cognitive 37) cmd/podman/machine/init.go:178— machine.initMachine has cognitive complexity 37 (threshold 15). Drivers by points: if/else 22 (32 pts), loops 3 (5 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventLogFile.Read (cognitive 37) REDACTED:113— EventLogFile.Read has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 15). Most of this is not in the body itself: 9 of the 37 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 170, 138, 156). 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.
ImageEngine.Mount (cognitive 37) pkg/domain/infra/abi/images.go:158— ImageEngine.Mount has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerRm (cognitive 37) pkg/domain/infra/tunnel/containers.go:243— ContainerEngine.ContainerRm has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 6 (14 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shim.Reset (cognitive 37) pkg/machine/shim/host.go:950— shim.Reset has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 3 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate.PodConfigToSpec (cognitive 37) pkg/specgen/generate/pod_create.go:273— generate.PodConfigToSpec has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 2 (6 pts), match/switch 1 (2 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.
connection.add (cognitive 36) cmd/podman/system/connection/add.go:119— connection.add has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (33 pts), match/switch 2 (3 pts) (nesting depth added 12). Of this number, 27 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.
Container.getContainerInspectData (cognitive 36) libpod/container_inspect.go:64— Container.getContainerInspectData has cognitive complexity 36 (threshold 15). Drivers by points: if/else 25 (33 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Container.mountNamedVolume (cognitive 36) libpod/container_internal.go:1952— Container.mountNamedVolume has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 1 (nesting depth added 16). Of this number, 34 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.
Runtime.Migrate (cognitive 36) libpod/runtime_migrate.go:21— Runtime.Migrate has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 3, match/switch 1 (3 pts), loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.UpdateVolumePlugins (cognitive 36) libpod/runtime_volume_common.go:262— Runtime.UpdateVolumePlugins has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 3 (4 pts), boolean chains 1 (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.
compat.convertLibpodNetworktoDockerNetwork (cognitive 36) pkg/api/handlers/compat/networks.go:164— compat.convertLibpodNetworktoDockerNetwork has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.SystemPrune (cognitive 36) pkg/domain/infra/abi/system.go:69— ContainerEngine.SystemPrune has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 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.
ContainerEngine.ContainerStart (cognitive 36) pkg/domain/infra/tunnel/containers.go:798— ContainerEngine.ContainerStart has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). Of this number, 32 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.
kube.envVarValue (cognitive 36) pkg/specgen/generate/kube/kube.go:1174— kube.envVarValue has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
trust.AddPolicyEntries (cognitive 36) REDACTED:158— trust.AddPolicyEntries has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.process (cognitive 35) cmd/quadlet/main.go:527— main.process has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 10). Of this number, 34 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.
libpod.readConmonPipeData (cognitive 35) REDACTED:1445— libpod.readConmonPipeData has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 1, match/switch 1 (nesting depth added 22). Of this number, 32 points are the body's own statements and 3 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.
Container.execStartAndAttach (cognitive 35) REDACTED:323— Container.execStartAndAttach has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 1 (nesting depth added 9). Of this number, 33 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.
Container.NetworkConnect (cognitive 35) libpod/networking_common.go:529— Container.NetworkConnect has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 3, loops 1 (nesting depth added 7). Of this number, 34 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.
ContainerEngine.ContainerRestore (cognitive 35) pkg/domain/infra/tunnel/containers.go:458— ContainerEngine.ContainerRestore has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (5 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.
EventJournalD.Read (cognitive 35) libpod/events/journal_linux.go:129— EventJournalD.Read has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (33 pts), boolean chains 1, loops 1 (nesting depth added 12). Of this number, 19 points are the body's own statements and 16 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.
network.networkCreate (cognitive 34) cmd/podman/networks/create.go:99— network.networkCreate has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.parent (cognitive 34) cmd/rootlessport/main.go:79— main.parent has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (30 pts), match/switch 1 (2 pts), jumps 1, loops 1 (nesting depth added 8). Of this number, 30 points are the body's own statements and 4 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.
Container.WaitForExit (cognitive 34) libpod/container_api.go:618— Container.WaitForExit has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (32 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.
Pod.Inspect (cognitive 34) libpod/pod_api.go:595— Pod.Inspect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 4 (7 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLiteState.addContainer (cognitive 34) libpod/sqlite_state_internal.go:404— SQLiteState.addContainer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 10). Of this number, 31 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.
compat.UpdateContainer (cognitive 34) pkg/api/handlers/compat/containers.go:785— compat.UpdateContainer has cognitive complexity 34 (threshold 15). Drivers by points: if/else 27 (32 pts), loops 1 (2 pts) (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.
abi.getKubePods (cognitive 34) pkg/domain/infra/abi/generate.go:300— abi.getKubePods has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (31 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.
ContainerEngine.ContainerUnmount (cognitive 34) pkg/domain/infra/abi/containers.go:1526— ContainerEngine.ContainerUnmount has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (4 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.
listLocal.build (cognitive 34) pkg/farm/list_builder.go:58— listLocal.build has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 2 (3 pts) (nesting depth added 13). Of this number, 29 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.
util.breakInsert (cognitive 34) REDACTED:437— util.breakInsert has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 4, 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.
common.DefineCreateFlags (cognitive 33) cmd/podman/common/create.go:33— common.DefineCreateFlags has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 5 (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.
generate.systemd (cognitive 33) cmd/podman/generate/systemd.go:129— generate.systemd has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 2, loops 1 (2 pts), match/switch 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.
logs.getTailLog (cognitive 33) libpod/logs/log.go:86— logs.getTailLog has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.migrateDB (cognitive 33) libpod/runtime_migrate.go:133— Runtime.migrateDB has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 5 (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.
SQLiteState.AllContainers (cognitive 33) libpod/sqlite_state.go:829— SQLiteState.AllContainers has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.GetEvents (cognitive 33) pkg/api/handlers/compat/events.go:21— compat.GetEvents has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 4, 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.
images.build (cognitive 33) REDACTED:1008— images.build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 1 (nesting depth added 8). Of this number, 30 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.
ImageEngine.List (cognitive 33) pkg/domain/infra/abi/images_list.go:15— ImageEngine.List has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 1, loops 1 (nesting depth added 17). Most of this is not in the body itself: 9 of the 33 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.
ContainerEngine.ContainerRunlabel (cognitive 33) pkg/domain/infra/abi/containers_runlabel.go:25— ContainerEngine.ContainerRunlabel has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), 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.
ps.GetContainerLists (cognitive 33) pkg/ps/ps.go:31— ps.GetContainerLists has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate.MakePod (cognitive 33) pkg/specgen/generate/pod_create.go:23— generate.MakePod has cognitive complexity 33 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 3 (nesting depth added 9). Of this number, 29 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.
containers.copyToContainer (cognitive 32) cmd/podman/containers/cp.go:339— containers.copyToContainer has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 5 (nesting depth added 7). Of this number, 21 points are the body's own statements and 11 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.
containers.create (cognitive 32) cmd/podman/containers/create.go:120— containers.create 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.
images.prepareContainerFiles (cognitive 32) REDACTED:588— images.prepareContainerFiles has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 2, 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.
ContainerEngine.ContainerClone (cognitive 32) pkg/domain/infra/abi/containers.go:1727— ContainerEngine.ContainerClone has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (26 pts), loops 2 (4 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.
ContainerEngine.PodClone (cognitive 32) pkg/domain/infra/abi/pods.go:322— ContainerEngine.PodClone has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 2 (4 pts), match/switch 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.
util.parseTriple (cognitive 32) REDACTED:356— util.parseTriple has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (21 pts), loops 3 (6 pts), boolean chains 5 (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.
images.imagePush (cognitive 31) cmd/podman/images/push.go:158— images.imagePush has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (31 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.
images.imageSearch (cognitive 31) cmd/podman/images/search.go:120— images.imageSearch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 3, match/switch 2, 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.
manifest.add (cognitive 31) cmd/podman/manifest/add.go:127— manifest.add has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.resultToBasicNetworkConfig (cognitive 31) libpod/networking_common.go:351— libpod.resultToBasicNetworkConfig has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 3 (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.
libpod.getLockManager (cognitive 31) libpod/runtime.go:231— libpod.getLockManager has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 19). 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.
Container.execLightweight (cognitive 31) REDACTED:1207— Container.execLightweight has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (28 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). Of this number, 28 points are the body's own statements and 3 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.
Container.canStopServiceContainer (cognitive 31) libpod/service.go:95— Container.canStopServiceContainer has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (4 pts), match/switch 1 (2 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.
events.newEventFromJournalEntry (cognitive 31) libpod/events/journal_linux.go:227— events.newEventFromJournalEntry has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (30 pts), 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.
compat.ListContainers (cognitive 31) pkg/api/handlers/compat/containers.go:106— compat.ListContainers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). 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.
filters.GenerateVolumeFilters (cognitive 31) pkg/domain/filters/volumes.go:16— filters.GenerateVolumeFilters has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 4 (9 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 18). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 63, 41). 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.
ContainerEngine.ContainerRestore (cognitive 31) pkg/domain/infra/abi/containers.go:732— ContainerEngine.ContainerRestore has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (6 pts), match/switch 1 (nesting depth added 17). Of this number, 27 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.
quadlet.addNetworks (cognitive 31) pkg/systemd/quadlet/quadlet.go:1855— quadlet.addNetworks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (29 pts), boolean chains 1, loops 1 (nesting depth added 20). 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.
util.getDevices (cognitive 31) pkg/util/utils_linux.go:180— util.getDevices has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 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.
containers.exec (cognitive 30) cmd/podman/containers/exec.go:130— containers.exec has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (26 pts), loops 3, 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.
farm.farmUpdate (cognitive 30) cmd/podman/farm/update.go:57— farm.farmUpdate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 12). Most of this is not in the body itself: 3 of the 30 points are its own statements and the rest belongs to one function literal inside it that branches (line 66). 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.
manifest.push (cognitive 30) cmd/podman/manifest/push.go:111— manifest.push has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (30 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.
localapi.CheckIfImageBuildPathsOnRunningMachine (cognitive 30) internal/localapi/utils.go:164— localapi.CheckIfImageBuildPathsOnRunningMachine has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.generateKubeSecurityContext (cognitive 30) REDACTED:1372— libpod.generateKubeSecurityContext has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.cleanupStorage (cognitive 30) libpod/container_internal.go:2073— Container.cleanupStorage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 9). Of this number, 25 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.
Runtime.mergeDBConfig (cognitive 30) libpod/runtime.go:1119— Runtime.mergeDBConfig has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 12 (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.
Runtime.NewPod (cognitive 30) libpod/runtime_pod_common.go:18— Runtime.NewPod has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5, loops 2 (nesting depth added 8). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.PushImage (cognitive 30) pkg/api/handlers/libpod/images_push.go:25— libpod.PushImage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (27 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
artifacts.Extract (cognitive 30) pkg/bindings/artifacts/extract.go:17— artifacts.Extract has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 2 (4 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.
ImageEngine.ManifestAnnotate (cognitive 30) pkg/domain/infra/abi/manifest.go:272— ImageEngine.ManifestAnnotate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (30 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.
ContainerEngine.containerStopImpl (cognitive 30) pkg/domain/infra/abi/containers.go:299— ContainerEngine.containerStopImpl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 11). 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 322). 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.
Farm.Build (cognitive 30) pkg/farm/farm.go:224— Farm.Build has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 4 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 11). Of this number, 15 points are the body's own statements and 15 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quadlet.handleUserRemap (cognitive 30) pkg/systemd/quadlet/quadlet.go:1794— quadlet.handleUserRemap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
util.ParseIDMapping (cognitive 30) REDACTED:960— util.ParseIDMapping has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
containers.copyFromContainer (cognitive 29) cmd/podman/containers/cp.go:205— containers.copyFromContainer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 4 (nesting depth added 3). Of this number, 16 points are the body's own statements and 13 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
validate.CheckAllLatestAndIDFile (cognitive 29) cmd/podman/validate/args.go:55— validate.CheckAllLatestAndIDFile has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 8 (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.
main.loadUnitDropins (cognitive 29) cmd/quadlet/main.go:193— main.loadUnitDropins has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (8 pts) (nesting depth added 13). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.detectCycles (cognitive 29) libpod/container_graph.go:104— libpod.detectCycles has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2, boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 117). 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.
Container.ExecHTTPStartAndAttach (cognitive 29) REDACTED:471— Container.ExecHTTPStartAndAttach has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (nesting depth added 7). Of this number, 27 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.
Container.exec (cognitive 29) REDACTED:829— Container.exec has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 838, 860). 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.
Container.getActiveExecSessions (cognitive 29) REDACTED:1038— Container.getActiveExecSessions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.CommitContainer (cognitive 29) pkg/api/handlers/libpod/images.go:486— libpod.CommitContainer has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (24 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). Of this number, 27 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.
updater.assembleTasks (cognitive 29) pkg/autoupdate/autoupdate.go:356— updater.assembleTasks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 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.
util.ToParams (cognitive 29) pkg/bindings/internal/util/util.go:54— util.ToParams has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (7 pts), match/switch 1 (2 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.
generate.GetDefaultNamespaceMode (cognitive 29) pkg/specgen/generate/namespaces.go:43— generate.GetDefaultNamespaceMode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 7, match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common.AutocompleteFormat (cognitive 28) cmd/podman/common/completion.go:1358— common.AutocompleteFormat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). None of this is in the body itself: all 28 points belong to one function literal inside it that branches (line 1360). 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.
Container.postDeleteHooks (cognitive 28) libpod/container_internal.go:2387— Container.postDeleteHooks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 1 (3 pts) (nesting depth added 20). 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.
Container.setupOCIHooks (cognitive 28) libpod/container_internal.go:2506— Container.setupOCIHooks has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2, loops 1 (2 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.
ConmonOCIRuntime.StopContainer (cognitive 28) REDACTED:342— ConmonOCIRuntime.StopContainer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 1, loops 1 (nesting depth added 10). Of this number, 17 points are the body's own statements and 11 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.
Pod.stopWithTimeout (cognitive 28) libpod/pod_api.go:150— Pod.stopWithTimeout has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.RemoveStorageContainer (cognitive 28) libpod/runtime_cstorage.go:63— Runtime.RemoveStorageContainer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 2, 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.
compat.GetImages (cognitive 28) pkg/api/handlers/compat/images.go:437— compat.GetImages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerCleanup (cognitive 28) pkg/domain/infra/abi/containers.go:1344— ContainerEngine.ContainerCleanup has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
emulation.parseBinfmtMisc (cognitive 28) pkg/emulation/binfmtmisc_linux.go:113— emulation.parseBinfmtMisc has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Farm.Schedule (cognitive 28) pkg/farm/farm.go:149— Farm.Schedule has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 4 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 170). 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.
generate.MapSpec (cognitive 28) pkg/specgen/generate/pod_create.go:172— generate.MapSpec has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (25 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.
images.sortImages (cognitive 27) cmd/podman/images/list.go:221— images.sortImages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 14). Of this number, 20 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.
libpod.startNode (cognitive 27) libpod/container_graph.go:202— libpod.startNode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4, 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.
Container.prepareProcessExec (cognitive 27) libpod/oci_conmon_exec_common.go:681— Container.prepareProcessExec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (24 pts), loops 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
compat.CreateContainer (cognitive 27) pkg/api/handlers/compat/containers_create.go:36— compat.CreateContainer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
libpod.ManifestPush (cognitive 27) pkg/api/handlers/libpod/manifests.go:351— libpod.ManifestPush has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
updater.updateUnit (cognitive 27) pkg/autoupdate/autoupdate.go:158— updater.updateUnit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 9). Of this number, 19 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.
infra.ParseIDMapping (cognitive 27) pkg/domain/infra/runtime_libpod.go:220— infra.ParseIDMapping has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 7 (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.
ImageEngine.ArtifactAdd (cognitive 27) REDACTED:98— ImageEngine.ArtifactAdd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (5 pts), loops 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.
vsock.loadHVSockRegistryEntries (cognitive 27) pkg/machine/hyperv/vsock/vsock.go:351— vsock.loadHVSockRegistryEntries has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 1, loops 1 (nesting depth added 11). Of this number, 24 points are the body's own statements and 3 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.
images.imagePull (cognitive 26) cmd/podman/images/pull.go:144— images.imagePull has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (22 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.
libpod.httpAttachTerminalCopy (cognitive 26) REDACTED:1552— libpod.httpAttachTerminalCopy has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 1 (3 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.
Container.restartWithTimeout (cognitive 26) libpod/container_internal.go:1681— Container.restartWithTimeout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 9). Of this number, 23 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.
Event.toHumanReadable (cognitive 26) libpod/events/events.go:46— Event.toHumanReadable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 1 (3 pts), boolean chains 1, 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.
ConmonOCIRuntime.Attach (cognitive 26) REDACTED:35— ConmonOCIRuntime.Attach has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (nesting depth added 7). 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.
Runtime.refresh (cognitive 26) libpod/runtime.go:899— Runtime.refresh has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLiteState.RenameVolume (cognitive 26) libpod/sqlite_state.go:1358— SQLiteState.RenameVolume has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19 (26 pts) (nesting depth added 7). Of this number, 23 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.
Volume.mount (cognitive 26) libpod/volume_internal_common.go:31— Volume.mount has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (23 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.
compat.inspectCandidate (cognitive 26) pkg/api/handlers/compat/distribution.go:84— compat.inspectCandidate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ps.ListContainerBatch (cognitive 26) pkg/ps/ps.go:171— ps.ListContainerBatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (25 pts), boolean chains 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 190). 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.
quadlet.ConvertKube (cognitive 26) pkg/systemd/quadlet/quadlet.go:1238— quadlet.ConvertKube has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 4, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
common.getImages (cognitive 25) cmd/podman/common/completion.go:224— common.getImages has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
containers.pullImage (cognitive 25) cmd/podman/containers/create.go:350— containers.pullImage 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.
containers.portsToString (cognitive 25) cmd/podman/containers/ps.go:494— containers.portsToString has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 9). 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.
inspector.inspectAll (cognitive 25) cmd/podman/inspect/inspect.go:203— inspector.inspectAll has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (24 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.
BoltState.getContainerFromDB (cognitive 25) libpod/boltdb_state_internal.go:192— BoltState.getContainerFromDB has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 1 (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.
libpod.redirectResponseToOutputStreams (cognitive 25) REDACTED:246— libpod.redirectResponseToOutputStreams has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 1 (3 pts), boolean chains 1, 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.
Container.NamespaceMode (cognitive 25) libpod/container.go:1504— Container.NamespaceMode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (2 pts), 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.
compat.executeBuild (cognitive 25) pkg/api/handlers/compat/images_build.go:902— compat.executeBuild has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (9 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). Of this number, 23 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.
ImageEngine.Push (cognitive 25) pkg/domain/infra/abi/images.go:350— ImageEngine.Push has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 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.
Container.Attach (cognitive 24) libpod/container_api.go:178— Container.Attach has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 1, match/switch 1 (nesting depth added 8). Of this number, 16 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.
Container.init (cognitive 24) libpod/container_internal.go:1029— Container.init 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.
Container.waitForHealthy (cognitive 24) libpod/container_internal.go:1339— Container.waitForHealthy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 1382). 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.
Container.waitForConmonToExitAndSave (cognitive 24) libpod/container_internal.go:1535— Container.waitForConmonToExitAndSave has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (24 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.
ConmonOCIRuntime.startExec (cognitive 24) libpod/oci_conmon_exec_common.go:328— ConmonOCIRuntime.startExec has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19 (20 pts), loops 3 (4 pts) (nesting depth added 2). Of this number, 22 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.
Runtime.RemoveContainersForImageCallback (cognitive 24) libpod/runtime_img.go:26— Runtime.RemoveContainersForImageCallback has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2, boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 27). 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.
SQLiteState.RemovePodContainers (cognitive 24) libpod/sqlite_state.go:1801— SQLiteState.RemovePodContainers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20 (23 pts), loops 1 (nesting depth added 3). 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: 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.
compat.SearchImages (cognitive 24) pkg/api/handlers/compat/images_search.go:21— compat.SearchImages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 1 (4 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.
auth.getConfigCredentials (cognitive 24) pkg/auth/auth.go:67— auth.getConfigCredentials has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 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.
containers.Commit (cognitive 24) pkg/bindings/containers/commit.go:22— containers.Commit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 2 (4 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.
abi.splitMultiDocYAML (cognitive 24) pkg/domain/infra/abi/play.go:1673— abi.splitMultiDocYAML has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (4 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.
abi.stopLoadedTemplateInstances (cognitive 24) pkg/domain/infra/abi/quadlet_utils.go:265— abi.stopLoadedTemplateInstances has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 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.
ImageEngine.remoteManifestInspect (cognitive 24) pkg/domain/infra/abi/manifest.go:107— ImageEngine.remoteManifestInspect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). Of this number, 22 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.
tunnel.getPodsByContext (cognitive 24) pkg/domain/infra/tunnel/helpers.go:91— tunnel.getPodsByContext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 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.
generate.applyHealthCheckOverrides (cognitive 24) pkg/specgen/generate/container.go:66— generate.applyHealthCheckOverrides has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (23 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.
specgenutil.MakeHealthCheckFromCli (cognitive 24) pkg/specgenutil/specgen.go:1010— specgenutil.MakeHealthCheckFromCli has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
containers.checkpoint (cognitive 23) cmd/podman/containers/checkpoint.go:87— containers.checkpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
main.exposePorts (cognitive 23) cmd/rootlessport/main.go:295— main.exposePorts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.waitForConmonExit (cognitive 23) libpod/container_api.go:697— libpod.waitForConmonExit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (6 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.
libpod.parseOptionIDs (cognitive 23) REDACTED:68— libpod.parseOptionIDs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (4 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.
libpod.getOverlayUpperAndWorkDir (cognitive 23) REDACTED:154— libpod.getOverlayUpperAndWorkDir has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 3, 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.
libpod.bindPort (cognitive 23) libpod/oci_util.go:66— libpod.bindPort has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, match/switch 1 (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.
Container.ExecRemove (cognitive 23) REDACTED:654— Container.ExecRemove has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (23 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.addResolvConf (cognitive 23) REDACTED:2300— Container.addResolvConf has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.Shutdown (cognitive 23) libpod/runtime.go:831— Runtime.Shutdown has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 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.
Volume.unmount (cognitive 23) libpod/volume_internal_common.go:145— Volume.unmount has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (23 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.
compat.processSecrets (cognitive 23) pkg/api/handlers/compat/images_build.go:363— compat.processSecrets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (4 pts) (nesting depth added 15). 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.
libpod.ManifestCreate (cognitive 23) pkg/api/handlers/libpod/manifests.go:40— libpod.ManifestCreate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (21 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.
images.processBuildResponse (cognitive 23) REDACTED:904— images.processBuildResponse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerRm (cognitive 23) pkg/domain/infra/abi/containers.go:483— ContainerEngine.ContainerRm has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 3 (nesting depth added 8). Of this number, 22 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.
tunnel.getContainersAndInputByContext (cognitive 23) pkg/domain/infra/tunnel/helpers.go:23— tunnel.getContainersAndInputByContext has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
define.ParseUSBs (cognitive 23) pkg/machine/define/usb.go:16— define.ParseUSBs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quadlet.handleSetWorkingDirectory (cognitive 23) pkg/systemd/quadlet/quadlet.go:2060— quadlet.handleSetWorkingDirectory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, 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.
util.getAvailableIDRanges (cognitive 23) REDACTED:554— util.getAvailableIDRanges has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (3 pts), match/switch 1 (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.
util.ParseIDMap (cognitive 23) REDACTED:734— util.ParseIDMap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 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.
EventJournalD.Write (cognitive 23) libpod/events/journal_linux.go:31— EventJournalD.Write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 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.
common.PrepareSigning (cognitive 22) cmd/podman/common/sign.go:63— common.PrepareSigning has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 pts) (nesting depth added 8). Of this number, 21 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.
libpod.podmanTopInner (cognitive 22) REDACTED:64— libpod.podmanTopInner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), loops 2, 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.
Container.prepare (cognitive 22) libpod/container_internal_linux.go:61— Container.prepare has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). Of this number, 15 points are the body's own statements and 7 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.
compat.ResizeTTY (cognitive 22) pkg/api/handlers/compat/resize.go:19— compat.ResizeTTY has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, 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.
libpod.InstallQuadlets (cognitive 22) REDACTED:178— libpod.InstallQuadlets has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 3 (4 pts) (nesting depth added 5). Of this number, 21 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.
ImageEngine.ManifestPush (cognitive 22) pkg/domain/infra/abi/manifest.go:473— ImageEngine.ManifestPush has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (19 pts), match/switch 1 (2 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.
ContainerEngine.playKubePVC (cognitive 22) pkg/domain/infra/abi/play.go:1470— ContainerEngine.playKubePVC has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.installQuadlet (cognitive 22) pkg/domain/infra/abi/quadlet.go:303— ContainerEngine.installQuadlet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (21 pts), match/switch 1 (nesting depth added 6). Of this number, 20 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.
tunnel.startAndAttach (cognitive 22) pkg/domain/infra/tunnel/containers.go:701— tunnel.startAndAttach has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 10). Of this number, 20 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.
ContainerEngine.ContainerWait (cognitive 22) pkg/domain/infra/tunnel/containers.go:39— ContainerEngine.ContainerWait has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 8). Of this number, 12 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.
ContainerEngine.ContainerRun (cognitive 22) pkg/domain/infra/tunnel/containers.go:896— ContainerEngine.ContainerRun has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sparseWriter.Write (cognitive 22) pkg/machine/compression/sparse_file_writer.go:55— sparseWriter.Write has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgen.SetupUserNS (cognitive 22) pkg/specgen/namespaces.go:482— specgen.SetupUserNS has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
kube.VolumeFromConfigMap (cognitive 22) pkg/specgen/generate/kube/volume.go:206— kube.VolumeFromConfigMap has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgenutil.getIOLimits (cognitive 22) pkg/specgenutil/specgen.go:77— specgenutil.getIOLimits has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (22 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.
specgenutil.getImageVolume (cognitive 22) pkg/specgenutil/volumes.go:671— specgenutil.getImageVolume has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
specgenutil.getArtifactVolume (cognitive 22) pkg/specgenutil/volumes.go:725— specgenutil.getArtifactVolume has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
systemd.IsSystemdSessionValid (cognitive 22) pkg/systemd/dbus.go:19— systemd.IsSystemdSessionValid has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (21 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.
generate.PodUnits (cognitive 22) pkg/systemd/generate/pods.go:134— generate.PodUnits has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 3 (4 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.
util.parseAutoTriple (cognitive 22) REDACTED:818— util.parseAutoTriple has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (5 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.
HyperVStubber.CreateVM (cognitive 22) pkg/machine/hyperv/stubber.go:64— HyperVStubber.CreateVM has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
artifact.list (cognitive 21) cmd/podman/artifact/list.go:86— artifact.list has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 1, loops 1, 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.
common.AutocompleteCpCommand (cognitive 21) cmd/podman/common/completion.go:877— common.AutocompleteCpCommand has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts) (nesting depth added 12). 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.
common.getStructFields (cognitive 21) cmd/podman/common/completion.go:1492— common.getStructFields has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 pts), boolean chains 1, jumps 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
containers.update (cognitive 21) cmd/podman/containers/update.go:132— containers.update 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.
system.printSystemCheckResults (cognitive 21) cmd/podman/system/check.go:86— system.printSystemCheckResults has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 9 (nesting depth added 5). Of this number, 19 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.
system.resetMachine (cognitive 21) cmd/podman/system/reset_machine.go:16— system.resetMachine has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (20 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.
main.transformSwagger (cognitive 21) hack/swagger-version-paths/main.go:67— main.transformSwagger has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (19 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.
libpod.bindPorts (cognitive 21) libpod/oci_util.go:35— libpod.bindPorts has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (10 pts) (nesting depth added 14). 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.
libpod.finalizeCtrSqlite (cognitive 21) libpod/sqlite_state_internal.go:278— libpod.finalizeCtrSqlite has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 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.
Container.handleRestartPolicy (cognitive 21) libpod/container_internal.go:275— Container.handleRestartPolicy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 1 (nesting depth added 4). 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: 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.
Container.stopInternal (cognitive 21) libpod/container_internal.go:1440— Container.stopInternal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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.
Container.resetHealthCheckTimers (cognitive 21) libpod/container_internal.go:2950— Container.resetHealthCheckTimers has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (19 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.
events.GetNextEntry (cognitive 21) libpod/events/journal_linux.go:308— events.GetNextEntry has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, match/switch 1 (2 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.
Runtime.RenumberLocks (cognitive 21) libpod/runtime_renumber.go:14— Runtime.RenumberLocks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.KillContainer (cognitive 21) pkg/api/handlers/compat/containers.go:242— compat.KillContainer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compat.ExecStartHandler (cognitive 21) pkg/api/handlers/compat/exec.go:146— compat.ExecStartHandler 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.
compat.Connect (cognitive 21) pkg/api/handlers/compat/networks.go:465— compat.Connect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (21 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.KubePlay (cognitive 21) pkg/api/handlers/REDACTED:81— libpod.KubePlay has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 2, boolean chains 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.
libpod.PodStats (cognitive 21) pkg/api/handlers/libpod/pods.go:555— libpod.PodStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Connection.DoRequest (cognitive 21) REDACTED:426— Connection.DoRequest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 4 (5 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.
images.Pull (cognitive 21) pkg/bindings/images/pull.go:24— images.Pull has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 2 (4 pts), jumps 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, 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.
images.Push (cognitive 21) pkg/bindings/images/push.go:24— images.Push has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 2 (4 pts), jumps 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, 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.
ImageEngine.Prune (cognitive 21) pkg/domain/infra/abi/images.go:59— ImageEngine.Prune has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (5 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.
ContainerEngine.KubeApply (cognitive 21) REDACTED:22— ContainerEngine.KubeApply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 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.
ContainerEngine.GenerateSpec (cognitive 21) pkg/domain/infra/abi/generate.go:51— ContainerEngine.GenerateSpec has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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.
ContainerEngine.VolumeInspect (cognitive 21) pkg/domain/infra/abi/volumes.go:96— ContainerEngine.VolumeInspect has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 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.
emulation.registeredBinfmtMisc (cognitive 21) pkg/emulation/binfmtmisc_linux.go:23— emulation.registeredBinfmtMisc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to one function literal inside it that branches (line 26). 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.
kube.getPodPorts (cognitive 21) pkg/specgen/generate/kube/kube.go:1367— kube.getPodPorts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (16 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.
specgenutil.CreatePortBindings (cognitive 21) pkg/specgenutil/util.go:82— specgenutil.CreatePortBindings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 3 (6 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.
trust.loadAndMergeConfig (cognitive 21) pkg/trust/registries.go:55— trust.loadAndMergeConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 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.
HyperVStubber.SetProviderAttrs (cognitive 21) pkg/machine/hyperv/stubber.go:700— HyperVStubber.SetProviderAttrs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2 (nesting depth added 5). Of this number, 17 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.
images.load (cognitive 20) REDACTED:70— images.load 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.
images.save (cognitive 20) cmd/podman/images/save.go:101— images.save has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2 (nesting depth added 8). Of this number, 12 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.
kube.printPlayReport (cognitive 20) cmd/podman/kube/play.go:548— kube.printPlayReport has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
machine.ssh (cognitive 20) cmd/podman/machine/ssh.go:44— machine.ssh has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (20 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.
system.eventsCmd (cognitive 20) cmd/podman/system/events.go:141— system.eventsCmd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 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.
system.prune (cognitive 20) cmd/podman/system/prune.go:57— system.prune 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.
libpod.newConmonOCIRuntime (cognitive 20) REDACTED:79— libpod.newConmonOCIRuntime has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 2 (3 pts) (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.generateInspectContainerConfig (cognitive 20) libpod/container_inspect.go:376— Container.generateInspectContainerConfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 6 (9 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Pod.GetPodPidInformation (cognitive 20) libpod/pod_top_linux.go:22— Pod.GetPodPidInformation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.PruneVolumes (cognitive 20) libpod/runtime_volume.go:174— Runtime.PruneVolumes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
compat.ExecCreateHandler (cognitive 20) pkg/api/handlers/compat/exec.go:27— compat.ExecCreateHandler has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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.
compat.CreateVolume (cognitive 20) pkg/api/handlers/compat/volumes.go:95— compat.CreateVolume has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
crutils.CRCreateRootFsDiffTar (cognitive 20) REDACTED:131— crutils.CRCreateRootFsDiffTar has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerCheckpoint (cognitive 20) pkg/domain/infra/tunnel/containers.go:404— ContainerEngine.ContainerCheckpoint has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
shim.Remove (cognitive 20) pkg/machine/shim/host.go:863— shim.Remove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 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.
MachineConfig.Remove (cognitive 20) pkg/machine/vmconfigs/machine.go:147— MachineConfig.Remove has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18 (20 pts) (nesting depth added 2). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 187). 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.
specgenutil.GetResources (cognitive 20) pkg/specgenutil/specgen.go:1318— specgenutil.GetResources has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, loops 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.
specgenutil.parseSplitPort (cognitive 20) pkg/specgenutil/util.go:160— specgenutil.parseSplitPort has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 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.
UnitFile.Parse (cognitive 20) pkg/systemd/parser/unitfile.go:382— UnitFile.Parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 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.
util.GetAutoOptions (cognitive 20) REDACTED:908— util.GetAutoOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 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.
containers.stop (cognitive 19) cmd/podman/containers/stop.go:103— containers.stop has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3, boolean chains 2, 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.
farm.build (cognitive 19) cmd/podman/farm/build.go:67— farm.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15 (18 pts), loops 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
images.build (cognitive 19) cmd/podman/images/build.go:81— images.build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
machine.inspect (cognitive 19) cmd/podman/machine/inspect.go:47— machine.inspect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1, 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.
manifest.annotate (cognitive 19) cmd/podman/manifest/annotate.go:79— manifest.annotate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
connection.inspect (cognitive 19) cmd/podman/system/connection/list.go:75— connection.inspect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 1, match/switch 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.
volumes.rm (cognitive 19) cmd/podman/volumes/rm.go:52— volumes.rm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, 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.
Container.refresh (cognitive 19) libpod/container_internal.go:664— Container.refresh has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 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.
Container.prepareToStart (cognitive 19) libpod/container_internal.go:823— Container.prepareToStart has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (19 pts) (nesting depth added 6). Of this number, 16 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.
Pod.GenerateForKube (cognitive 19) REDACTED:45— Pod.GenerateForKube has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runtime.PruneBuildContainers (cognitive 19) libpod/runtime.go:1342— Runtime.PruneBuildContainers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 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.
SQLiteState.AddPod (cognitive 19) libpod/sqlite_state.go:1656— SQLiteState.AddPod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (19 pts) (nesting depth added 3). Of this number, 16 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.
SQLiteState.RemovePod (cognitive 19) libpod/sqlite_state.go:1726— SQLiteState.RemovePod has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (19 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ContainerEngine.ContainerInspect (cognitive 19) pkg/domain/infra/abi/containers.go:563— ContainerEngine.ContainerInspect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (18 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.
ContainerEngine.NetworkInspect (cognitive 19) pkg/domain/infra/abi/network.go:69— ContainerEngine.NetworkInspect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 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.
GvProxyNotifier.handleConnection (cognitive 19) pkg/machine/gvproxy_notify.go:108— GvProxyNotifier.handleConnection has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ocipull.GetDiskArtifactReference (cognitive 19) pkg/machine/ocipull/source.go:45— ocipull.GetDiskArtifactReference has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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.
specgen.parseBridgeNetworkOptions (cognitive 19) pkg/specgen/namespaces.go:437— specgen.parseBridgeNetworkOptions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 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.
generate.getSeccompConfig (cognitive 19) pkg/specgen/generate/config_linux_seccomp.go:19— generate.getSeccompConfig has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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.
common.getPathCompletion (cognitive 18) cmd/podman/common/completion.go:427— common.getPathCompletion has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 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.
containers.removeContainers (cognitive 18) cmd/podman/containers/rm.go:146— containers.removeContainers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse.parseEnvOrLabel (cognitive 18) cmd/podman/parse/net.go:102— parse.parseEnvOrLabel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.NewContainerEngine (cognitive 18) cmd/podman/registry/registry.go:63— registry.NewContainerEngine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
secrets.inspect (cognitive 18) cmd/podman/secrets/inspect.go:61— secrets.inspect has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (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.
localapi.FindMachineByPort (cognitive 18) internal/localapi/utils.go:29— localapi.FindMachineByPort 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.
libpod.WithStorageConfig (cognitive 18) libpod/options.go:40— libpod.WithStorageConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (18 pts) (nesting depth added 4). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 41). 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.
Container.NetworkMode (cognitive 18) libpod/container.go:1438— Container.NetworkMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (3 pts), match/switch 1 (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.
Container.setupStorageMapping (cognitive 18) libpod/container_internal.go:403— Container.setupStorageMapping has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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.
ConmonOCIRuntime.sharedConmonArgs (cognitive 18) REDACTED:1323— ConmonOCIRuntime.sharedConmonArgs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
storageService.CreateContainerStorage (cognitive 18) libpod/storage.go:71— storageService.CreateContainerStorage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (18 pts) (nesting depth added 5). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.Restore (cognitive 18) pkg/api/handlers/libpod/containers.go:304— libpod.Restore has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.processMultipartQuadlets (cognitive 18) REDACTED:118— libpod.processMultipartQuadlets 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, 14 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.
containers.Logs (cognitive 18) pkg/bindings/containers/logs.go:16— containers.Logs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (2 pts), 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.
manifests.Push (cognitive 18) pkg/bindings/manifests/manifests.go:240— manifests.Push has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 2 (4 pts), loops 1 (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.
ImageEngine.digestFromDigestOrManifestListMember (cognitive 18) pkg/domain/infra/abi/manifest.go:401— ImageEngine.digestFromDigestOrManifestListMember has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.SecretRm (cognitive 18) pkg/domain/infra/tunnel/secrets.go:59— ContainerEngine.SecretRm 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.
QEMUStubber.stopLocked (cognitive 18) pkg/machine/qemu/machine.go:147— QEMUStubber.stopLocked 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.
generate.BlockAccessToKernelFilesystems (cognitive 18) pkg/specgen/generate/config_linux.go:99— generate.BlockAccessToKernelFilesystems has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 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.
generate.CheckName (cognitive 18) pkg/specgen/generate/container.go:609— generate.CheckName has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), boolean chains 1, 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.
kube.envVarsFrom (cognitive 18) pkg/specgen/generate/kube/kube.go:1137— kube.envVarsFrom has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quadlet.ConvertBuild (cognitive 18) pkg/systemd/quadlet/quadlet.go:1421— quadlet.ConvertBuild has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, 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.
main.parseCommands (cognitive 17) cmd/podman/main.go:80— main.parseCommands has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 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.
network.networkRm (cognitive 17) cmd/podman/networks/rm.go:52— network.networkRm has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 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.
registry.setXdgDirs (cognitive 17) cmd/podman/registry/config.go:181— registry.setXdgDirs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.Update (cognitive 17) libpod/container_api.go:117— Container.Update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.Unmount (cognitive 17) libpod/container_api.go:491— Container.Unmount has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 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.
Container.removeAllExecSessions (cognitive 17) REDACTED:1094— Container.removeAllExecSessions 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.
Container.resolveWorkDir (cognitive 17) REDACTED:915— Container.resolveWorkDir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 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.
Container.Top (cognitive 17) REDACTED:187— Container.Top has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (4 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.
ConmonOCIRuntime.ExecStopContainer (cognitive 17) libpod/oci_conmon_exec_common.go:209— ConmonOCIRuntime.ExecStopContainer 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.
Pod.maybeStopServiceContainer (cognitive 17) libpod/service.go:145— Pod.maybeStopServiceContainer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 3). 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 160). 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.
SQLiteState.AddVolume (cognitive 17) libpod/sqlite_state.go:2000— SQLiteState.AddVolume has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15 (17 pts) (nesting depth added 2). 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: 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.
compat.ListVolumes (cognitive 17) pkg/api/handlers/compat/volumes.go:25— compat.ListVolumes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.CreateContainer (cognitive 17) pkg/api/handlers/libpod/containers_create.go:34— libpod.CreateContainer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bindings.tcpClient (cognitive 17) REDACTED:310— bindings.tcpClient 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.
abi.setUpClusterClient (cognitive 17) REDACTED:94— abi.setUpClusterClient has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4 (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.
abi.parseMultiQuadletFile (cognitive 17) pkg/domain/infra/abi/quadlet.go:390— abi.parseMultiQuadletFile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.ContainerStats (cognitive 17) pkg/domain/infra/abi/containers.go:1624— ContainerEngine.ContainerStats has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, match/switch 2, jumps 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1653, 1634). 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.
ImageEngine.Save (cognitive 17) REDACTED:315— ImageEngine.Save has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageEngine.Build (cognitive 17) REDACTED:417— ImageEngine.Build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (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.
env.parseEnv (cognitive 17) pkg/env/env.go:91— env.parseEnv 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.
machine.WaitAPIAndPrintInfo (cognitive 17) pkg/machine/machine_common.go:33— machine.WaitAPIAndPrintInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DynamicIgnition.GenerateIgnitionConfig (cognitive 17) pkg/machine/ignition/ignition.go:108— DynamicIgnition.GenerateIgnitionConfig 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.
generate.createPodOptions (cognitive 17) pkg/specgen/generate/pod_create.go:117— generate.createPodOptions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 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.
kube.VolumeFromSecret (cognitive 17) pkg/specgen/generate/kube/volume.go:145— kube.VolumeFromSecret has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (4 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.
quadlet.ConvertNetwork (cognitive 17) pkg/systemd/quadlet/quadlet.go:1021— quadlet.ConvertNetwork has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (2 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.
trust.parseUids (cognitive 17) REDACTED:97— trust.parseUids has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (15 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.
util.FiltersFromRequest (cognitive 17) pkg/util/filters.go:19— util.FiltersFromRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (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.
wutil.matchOutputLine (cognitive 17) pkg/machine/wsl/wutil/wutil.go:101— wutil.matchOutputLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (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.
artifact.artifactPush (cognitive 16) cmd/podman/artifact/push.go:124— artifact.artifactPush 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.
common.GetHealthCheckOverrideConfig (cognitive 16) cmd/podman/common/create.go:1094— common.GetHealthCheckOverrideConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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.
containers.copyContainerToContainer (cognitive 16) cmd/podman/containers/cp.go:126— containers.copyContainerToContainer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 4. Of this number, 9 points are the body's own statements and 7 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.
farm.rm (cognitive 16) cmd/podman/farm/remove.go:45— farm.rm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (4 pts), boolean chains 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 47). 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.
kube.teardown (cognitive 16) cmd/podman/kube/play.go:451— kube.teardown has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 4, loops 4 (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
machine.hostInfo (cognitive 16) cmd/podman/machine/info.go:95— machine.hostInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
system.reset (cognitive 16) cmd/podman/system/reset.go:47— system.reset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.loadUnitsFromDir (cognitive 16) cmd/quadlet/main.go:95— main.loadUnitsFromDir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
registry.StartWithOptions (cognitive 16) hack/podman-registry-go/registry.go:46— registry.StartWithOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
libpod.parseIDMapMountOption (cognitive 16) REDACTED:109— libpod.parseIDMapMountOption has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
libpod.readStdio (cognitive 16) REDACTED:291— libpod.readStdio has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, 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.
Container.cGroupPath (cognitive 16) libpod/container.go:1164— Container.cGroupPath has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 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.
Container.syncContainer (cognitive 16) libpod/container_internal.go:364— Container.syncContainer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Container.unpause (cognitive 16) libpod/container_internal.go:1640— Container.unpause has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 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.
Container.setupSystemd (cognitive 16) libpod/container_internal_linux.go:225— Container.setupSystemd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 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.
Container.newContainerEventWithInspectData (cognitive 16) libpod/events.go:46— Container.newContainerEventWithInspectData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (16 pts) (nesting depth added 7). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pod.maybeRemoveServiceContainer (cognitive 16) libpod/service.go:258— Pod.maybeRemoveServiceContainer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 273). 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.
SQLiteState.RemoveVolume (cognitive 16) libpod/sqlite_state.go:2069— SQLiteState.RemoveVolume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 1 (nesting depth added 2). 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: 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.
SQLiteState.removeContainerWithTx (cognitive 16) libpod/sqlite_state_internal.go:524— SQLiteState.removeContainerWithTx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 pts) (nesting depth added 6). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 527). 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.
SQLiteState.networkModify (cognitive 16) libpod/sqlite_state_internal.go:573— SQLiteState.networkModify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, match/switch 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.
compat.StopContainer (cognitive 16) pkg/api/handlers/compat/containers_stop.go:19— compat.StopContainer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
libpod.PullArtifact (cognitive 16) pkg/api/handlers/libpod/artifacts.go:62— libpod.PullArtifact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), 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.
libpod.ExportImages (cognitive 16) pkg/api/handlers/libpod/images.go:256— libpod.ExportImages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kube.PlayWithBody (cognitive 16) pkg/bindings/kube/kube.go:29— kube.PlayWithBody has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
entities.ToPodSpecGen (cognitive 16) pkg/domain/entities/pods.go:312— entities.ToPodSpecGen has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ImageEngine.ArtifactRm (cognitive 16) pkg/domain/infra/abi/artifact.go:101— ImageEngine.ArtifactRm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 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.
ContainerEngine.PodPs (cognitive 16) pkg/domain/infra/abi/pods.go:484— ContainerEngine.PodPs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerEngine.PodInspect (cognitive 16) pkg/domain/infra/abi/pods.go:525— ContainerEngine.PodInspect 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.
OSTree.Upgrade (cognitive 16) pkg/machine/os/ostree.go:49— OSTree.Upgrade has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QEMUStubber.StartVM (cognitive 16) REDACTED:143— QEMUStubber.StartVM has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 2 (nesting depth added 3). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, 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.
UsernsMode.GetKeepIDOptions (cognitive 16) pkg/namespaces/namespaces.go:64— UsernsMode.GetKeepIDOptions 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.
trust.descriptionsOfPolicyRequirements (cognitive 16) pkg/trust/trust.go:80— trust.descriptionsOfPolicyRequirements has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
util.fillIDMap (cognitive 16) REDACTED:640— util.fillIDMap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (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.
WSLStubber.SetProviderAttrs (cognitive 16) pkg/machine/wsl/stubber.go:127— WSLStubber.SetProviderAttrs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D4 · Code Duplication· Near-duplicate member family (4 members, 30 shared lines) · ×1
Near-duplicate member family (4 members, 30 shared lines) libpod/pod_api.go:276— libpod/pod_api.go:276-323 | libpod/pod_api.go:337-379 | libpod/pod_api.go:393-435 | libpod/pod_api.go:506-555 — These 4 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (61 shared lines) pkg/specgen/generate/oci_freebsd.go:20— pkg/specgen/generate/oci_freebsd.go:20-170 | pkg/specgen/generate/oci_linux.go:103-375 — These two members are variants of one another: 61 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (53 shared lines) REDACTED:323— REDACTED:323-467 | REDACTED:473-612 — These two members are variants of one another: 53 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (43 shared lines) pkg/domain/infra/runtime_libpod.go:220— pkg/domain/infra/runtime_libpod.go:220-294 | REDACTED:960-1046 — These two members are variants of one another: 43 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (34 shared lines) pkg/api/handlers/libpod/images_push.go:25— pkg/api/handlers/libpod/images_push.go:25-179 | pkg/api/handlers/libpod/manifests.go:351-491 — These two members are variants of one another: 34 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (26 shared lines) REDACTED:356— REDACTED:356-432 | REDACTED:818-883 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) libpod/sqlite_state.go:829— libpod/sqlite_state.go:829-902 | libpod/sqlite_state.go:1600-1653 — 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· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) pkg/api/handlers/compat/containers.go:754— pkg/api/handlers/compat/containers.go:754-783 | pkg/api/handlers/compat/exec.go:237-277 | pkg/api/handlers/compat/images.go:256-323 | pkg/api/handlers/compat/images.go:437-517 | pkg/api/handlers/compat/images.go:519-573 | pkg/api/handlers/libpod/autoupdate.go:22-89 | pkg/api/handlers/libpod/containers.go:461-533 | pkg/api/handlers/libpod/pods.go:476-542 | pkg/api/handlers/libpod/system.go:20-59 | pkg/api/handlers/libpod/volumes.go:276-313 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) pkg/api/handlers/compat/containers_prune.go:20— pkg/api/handlers/compat/containers_prune.go:20-69 | pkg/api/handlers/compat/images_prune.go:21-75 | pkg/api/handlers/compat/networks.go:258-293 | pkg/api/handlers/compat/secrets.go:21-52 | pkg/api/handlers/compat/volumes.go:25-93 | pkg/api/handlers/libpod/networks.go:77-101 | pkg/api/handlers/libpod/volumes.go:118-135 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (74 lines × 2) pkg/signal/signal_unix.go:15— pkg/signal/signal_unix.go:15-88 | pkg/signal/signal_unsupported.go:15-88 — before extracting anything, compare `pkg/signal/signal_unix.go` and `pkg/signal/signal_unsupported.go` as WHOLE FILES: 92% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/signal/signal_unix.go:15` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (53 lines × 2) cmd/podman/artifact/push.go:133— cmd/podman/artifact/push.go:133-185 | cmd/podman/images/push.go:166-218 — `cmd/podman/artifact/push.go` and `cmd/podman/images/push.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 71 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. 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 (50–51 lines × 2) libpod/container_internal_freebsd.go:51— libpod/container_internal_freebsd.go:51-100 | libpod/container_internal_linux.go:87-137 — before extracting anything, compare `libpod/container_internal_freebsd.go` and `libpod/container_internal_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_internal_freebsd.go:51` it begins part-way through the construct above it, so those 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 (41 lines × 2) pkg/specgen/generate/config_freebsd.go:55— pkg/specgen/generate/config_freebsd.go:55-95 | pkg/specgen/generate/config_linux.go:57-97 — before extracting anything, compare `pkg/specgen/generate/config_freebsd.go` and `pkg/specgen/generate/config_linux.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/config_freebsd.go:55` 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 (33 lines × 2) pkg/specgen/generate/namespaces_freebsd.go:19— pkg/specgen/generate/namespaces_freebsd.go:19-51 | pkg/specgen/generate/namespaces_linux.go:76-108 — 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 (30–31 lines × 2) REDACTED:368— REDACTED:368-398 | REDACTED:552-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) pkg/bindings/manifests/manifests.go:81— pkg/bindings/manifests/manifests.go:81-108 | pkg/bindings/manifests/manifests.go:118-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (27 lines × 2) cmd/podman/machine/info.go:67— cmd/podman/machine/info.go:67-93 | cmd/podman/system/info.go:94-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. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/machine/info.go:67` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (15–27 lines × 2) pkg/api/handlers/compat/volumes.go:230— pkg/api/handlers/compat/volumes.go:230-256 | pkg/api/handlers/libpod/volumes.go:183-197 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/volumes.go:230` it begins part-way through the construct above it, so those exact lines 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–22 lines × 3) pkg/api/handlers/compat/volumes.go:234— pkg/api/handlers/compat/volumes.go:234-255 | pkg/api/handlers/libpod/networks.go:114-122 | pkg/api/handlers/libpod/volumes.go:187-196 — `pkg/api/handlers/compat/volumes.go` and `pkg/api/handlers/libpod/volumes.go` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/volumes.go:234` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) REDACTED:674— REDACTED:674-694 | libpod/oci_conmon_exec_common.go:657-677 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:674` 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 (19–21 lines × 2) pkg/domain/infra/abi/manifest.go:224— pkg/domain/infra/abi/manifest.go:224-244 | pkg/domain/infra/abi/manifest.go:274-292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) libpod/boltdb_state_internal.go:224— libpod/boltdb_state_internal.go:224-242 | libpod/sqlite_state_internal.go:301-318 — 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 `libpod/boltdb_state_internal.go:224` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) libpod/oci_conmon_exec_common.go:50— libpod/oci_conmon_exec_common.go:50-68 | libpod/oci_conmon_exec_common.go:115-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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `error` to `chan` in one and `cancel <-chan bool, hijackDone chan<- bool, holdConnOpen <-chan bool, newSize *resize.TerminalSize, ) (int, chan error,` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17 lines × 4) libpod/pod_api.go:277— libpod/pod_api.go:277-293 | libpod/pod_api.go:338-354 | libpod/pod_api.go:394-410 | libpod/pod_api.go:507-523 — 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 `libpod/pod_api.go:277` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (16–17 lines × 2) libpod/boltdb_state_internal.go:208— libpod/boltdb_state_internal.go:208-223 | libpod/sqlite_state_internal.go:284-300 — 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 `libpod/boltdb_state_internal.go:208` it does not close everything it opens, so those exact lines 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–17 lines × 2) REDACTED:383— REDACTED:383-397 | REDACTED:538-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:383` it begins part-way through the construct above it, so those 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 (15–16 lines × 6) cmd/podman/containers/init.go:70— cmd/podman/containers/init.go:70-84 | cmd/podman/containers/kill.go:108-122 | cmd/podman/containers/pause.go:110-124 | cmd/podman/containers/restart.go:122-136 | cmd/podman/containers/stop.go:144-158 | cmd/podman/containers/unpause.go:108-123 — before extracting anything, compare `cmd/podman/containers/pause.go` and `cmd/podman/containers/unpause.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/init.go:70` 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–16 lines × 3) pkg/api/handlers/compat/containers.go:113— pkg/api/handlers/compat/containers.go:113-126 | pkg/api/handlers/libpod/containers.go:78-91 | pkg/api/handlers/libpod/images.go:127-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers.go:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14–15 lines × 3) pkg/api/handlers/compat/images_push.go:101— pkg/api/handlers/compat/images_push.go:101-114 | pkg/api/handlers/libpod/images_push.go:67-81 | pkg/api/handlers/libpod/manifests.go:216-229 — 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 `pkg/api/handlers/compat/images_push.go:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also 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–14 lines × 3) libpod/container_api.go:61— libpod/container_api.go:61-72 | libpod/container_internal.go:845-856 | libpod/container_internal.go:1227-1240 — 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 `libpod/container_api.go:61` it begins part-way through the construct above it, so those 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, `libpod/container_internal.go:1241` calls `Debugf`, `ID` and `libpod/container_internal.go:858` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 3) pkg/domain/filters/containers.go:234— pkg/domain/filters/containers.go:234-247 | pkg/domain/filters/containers.go:535-548 | pkg/domain/filters/pods.go:136-149 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:234` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/domain/filters/pods.go:133` calls `CreatedTime`, `Before` and `pkg/domain/filters/containers.go:232` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) pkg/domain/infra/abi/containers.go:199— pkg/domain/infra/abi/containers.go:199-211 | pkg/domain/infra/abi/containers.go:220-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 3) libpod/container_api.go:56— libpod/container_api.go:56-68 | libpod/container_internal.go:840-852 | libpod/container_internal.go:1712-1722 — 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 `libpod/container_api.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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (13 lines × 3) pkg/domain/infra/abi/manifest.go:224— pkg/domain/infra/abi/manifest.go:224-236 | pkg/domain/infra/abi/manifest.go:274-286 | pkg/domain/infra/abi/manifest.go:372-384 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–13 lines × 2) REDACTED:617— REDACTED:617-627 | REDACTED:763-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:617` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–13 lines × 3) pkg/api/handlers/libpod/artifacts.go:73— pkg/api/handlers/libpod/artifacts.go:73-76 | pkg/api/handlers/libpod/artifacts.go:230-242 | pkg/api/handlers/libpod/artifacts.go:253-265 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 4) cmd/podman/common/completion.go:188— cmd/podman/common/completion.go:188-199 | cmd/podman/common/completion.go:211-222 | cmd/podman/common/completion.go:368-379 | cmd/podman/machine/machine.go:127-137 — 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 `cmd/podman/common/completion.go:188` 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–12 lines × 2) pkg/api/handlers/libpod/images_push.go:44— pkg/api/handlers/libpod/images_push.go:44-53 | pkg/api/handlers/libpod/manifests.go:367-378 — before extracting anything, compare `pkg/api/handlers/libpod/images_push.go` and `pkg/api/handlers/libpod/manifests.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images_push.go:44` it begins part-way through the construct above it, so those 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 × 6) pkg/api/handlers/compat/images_push.go:105— pkg/api/handlers/compat/images_push.go:105-115 | pkg/api/handlers/libpod/images_push.go:71-82 | pkg/api/handlers/REDACTED:166-176 | pkg/api/handlers/libpod/manifests.go:220-230 | pkg/api/handlers/libpod/manifests.go:315-325 | pkg/api/handlers/libpod/manifests.go:637-647 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. 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, `pkg/api/handlers/libpod/manifests.go:314` calls `GetName` and `pkg/api/handlers/compat/images_push.go:103` 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–10 lines × 2) pkg/specgen/volumes.go:189— pkg/specgen/volumes.go:189-196 | pkg/specgen/volumes.go:204-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/volumes.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–9 lines × 2) pkg/api/handlers/compat/exec.go:243— pkg/api/handlers/compat/exec.go:243-249 | pkg/api/handlers/libpod/pods.go:482-490 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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–9 lines × 2) pkg/api/handlers/libpod/images.go:184— pkg/api/handlers/libpod/images.go:184-192 | pkg/api/handlers/libpod/images.go:265-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (7–8 lines × 2) REDACTED:484— REDACTED:484-490 | REDACTED:1858-1865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:484` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:490` calls `AddMount`, `Infof` and `REDACTED:1865` 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–8 lines × 2) pkg/domain/infra/abi/images.go:837— pkg/domain/infra/abi/images.go:837-844 | pkg/domain/infra/abi/images.go:888-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 8) pkg/api/handlers/compat/containers.go:213— pkg/api/handlers/compat/containers.go:213-220 | pkg/api/handlers/compat/containers_restart.go:30-36 | pkg/api/handlers/compat/containers_stop.go:31-37 | pkg/api/handlers/compat/images_remove.go:27-34 | pkg/api/handlers/libpod/containers.go:234-241 | pkg/api/handlers/libpod/images.go:753-759 | pkg/api/handlers/libpod/pods.go:139-146 | pkg/api/handlers/libpod/pods.go:248-255 — there are 8 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers.go:213` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (7 lines × 6) pkg/domain/infra/abi/pods.go:75— pkg/domain/infra/abi/pods.go:75-81 | pkg/domain/infra/abi/pods.go:141-147 | pkg/domain/infra/abi/pods.go:175-181 | pkg/domain/infra/abi/pods.go:204-210 | pkg/domain/infra/abi/pods.go:230-236 | pkg/domain/infra/abi/pods.go:260-266 — 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 `pkg/domain/infra/abi/pods.go:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 5) pkg/api/handlers/libpod/pods.go:111— pkg/api/handlers/libpod/pods.go:111-117 | pkg/api/handlers/libpod/pods.go:197-203 | pkg/api/handlers/libpod/pods.go:285-291 | pkg/api/handlers/libpod/pods.go:336-342 | pkg/api/handlers/libpod/pods.go:362-368 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also 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) pkg/api/handlers/compat/containers_pause.go:14— pkg/api/handlers/compat/containers_pause.go:14-22 | pkg/api/handlers/compat/containers_start.go:32-38 | pkg/api/handlers/compat/containers_unpause.go:14-22 | pkg/api/handlers/libpod/containers.go:164-170 — 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 (4–7 lines × 5) pkg/api/handlers/compat/containers.go:251— pkg/api/handlers/compat/containers.go:251-254 | pkg/api/handlers/compat/secrets.go:61-68 | pkg/api/handlers/libpod/containers_stats.go:33-36 | pkg/api/handlers/REDACTED:267-274 | pkg/api/handlers/libpod/system.go:83-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/secrets.go:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/api/handlers/compat/containers.go:251` calls `Decode`, `Query` and `pkg/api/handlers/compat/secrets.go:61` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 2) pkg/api/handlers/libpod/autoupdate.go:35— pkg/api/handlers/libpod/autoupdate.go:35-40 | pkg/api/handlers/libpod/system.go:32-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 `pkg/api/handlers/libpod/autoupdate.go:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 5) pkg/api/handlers/libpod/networks.go:22— pkg/api/handlers/libpod/networks.go:22-27 | pkg/api/handlers/libpod/networks.go:104-109 | pkg/api/handlers/libpod/networks.go:150-155 | pkg/api/handlers/libpod/networks.go:206-211 | pkg/api/handlers/libpod/networks.go:229-234 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) libpod/sqlite_state.go:633— libpod/sqlite_state.go:633-638 | libpod/sqlite_state.go:849-854 | libpod/sqlite_state.go:879-884 | libpod/sqlite_state.go:1631-1636 — 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 `libpod/sqlite_state.go:633` it does not close everything it opens, so those exact lines 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) libpod/sqlite_state.go:2229— libpod/sqlite_state.go:2229-2234 | libpod/sqlite_state.go:2272-2277 | libpod/sqlite_state.go:2325-2330 — all 3 copies are in the same file, so extract the block into one function there and call 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 `libpod/sqlite_state.go:2229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 10) pkg/api/handlers/compat/containers.go:217— pkg/api/handlers/compat/containers.go:217-222 | pkg/api/handlers/compat/containers_restart.go:33-38 | pkg/api/handlers/compat/containers_stop.go:34-38 | pkg/api/handlers/compat/images_remove.go:31-35 | pkg/api/handlers/libpod/containers.go:238-243 | pkg/api/handlers/libpod/images.go:188-193 | pkg/api/handlers/libpod/images.go:756-761 | pkg/api/handlers/libpod/pods.go:143-147 | pkg/api/handlers/libpod/pods.go:252-256 | REDACTED:296-301 — there are 10 copies across 8 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 10 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 6) cmd/podman-testing/create.go:91— cmd/podman-testing/create.go:91-99 | cmd/podman-testing/create.go:101-109 | cmd/podman-testing/create.go:111-119 | cmd/podman-testing/create.go:121-129 | cmd/podman-testing/remove.go:86-93 | cmd/podman-testing/remove.go:95-102 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 4) pkg/specgenutil/volumes.go:206— pkg/specgenutil/volumes.go:206-216 | pkg/specgenutil/volumes.go:244-254 | pkg/specgenutil/volumes.go:256-266 | pkg/specgenutil/volumes.go:268-278 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 6) pkg/api/handlers/compat/containers.go:50— pkg/api/handlers/compat/containers.go:50-57 | pkg/api/handlers/libpod/artifacts.go:413-418 | pkg/api/handlers/libpod/containers.go:39-46 | pkg/api/handlers/libpod/containers.go:323-329 | pkg/api/handlers/libpod/images.go:690-695 | pkg/api/handlers/libpod/manifests.go:758-766 — 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 `pkg/api/handlers/compat/containers.go:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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, `pkg/api/handlers/libpod/containers.go:36` calls `GetName` and `pkg/api/handlers/libpod/manifests.go:754` 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 × 7) libpod/sqlite_state.go:735— libpod/sqlite_state.go:735-741 | libpod/sqlite_state.go:1215-1221 | libpod/sqlite_state.go:1272-1278 | libpod/sqlite_state.go:1735-1741 | libpod/sqlite_state.go:1810-1816 | libpod/sqlite_state.go:1933-1939 | libpod/sqlite_state_internal.go:372-378 — there are 7 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:735` it does not close everything it opens, so those 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.
Orphaned file pkg/api/server/register_pods.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/systemd/parser/split.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/podman/system/connection/add.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 libpod/service.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/domain/infra/abi/containers_runlabel.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/emulation/elf.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file cmd/podman/containers/rm.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/podman/containers/checkpoint.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/machine/ports/ports.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/api/server/register_archive.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/specgen/generate/namespaces_linux.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file cmd/podman/images/history.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/podman/farm/build.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/podman/kube/generate.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/bindings/kube/kube.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/domain/infra/abi/parse/parse.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/api/server/idle/tracker.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/specgen/generate/config_freebsd.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/machine/env/dir.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/podman/validate/args.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/podman/kube/apply.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/machine/qemu/virtiofsd.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/podman/images/mount.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/copy/fileinfo.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate REDACTED:486— `!streams.Stdin && !streams.Stdout && !streams.Stderr` appears character-identically in 2 files — REDACTED, libpod/oci_conmon_exec_common.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/podman/secrets/rm.go:36— `(len(args) > 0 && rmOptions.All) || (len(args) < 1 && !rmOptions.All)` appears character-identically in 2 files — cmd/podman/secrets/rm.go, cmd/podman/volumes/rm.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/specgen/generate/namespaces_freebsd.go:30— `(s.NetNS.NSMode == specgen.Host && hostname == "") || s.UtsNS.NSMode == specgen.Host` appears character-identically in 2 files — pkg/specgen/generate/namespaces_freebsd.go, pkg/specgen/generate/namespaces_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libpod/container_internal_freebsd.go:52— `c.config.CreateNetNS && noNetNS && !c.config.PostConfigureNetNS` appears character-identically in 2 files — libpod/container_internal_freebsd.go, libpod/container_internal_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libpod/container.go:1165— `c.config.NoCgroups || c.config.CgroupsMode == "disabled"` appears character-identically in 2 files — libpod/container.go, libpod/container_validate.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 libpod/container.go:1091— `c.state.State != define.ContainerStateRunning && c.state.State != define.ContainerStatePaused` appears character-identically in 2 files — libpod/container.go, libpod/stats_common.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:1283— `err != nil && !errors.Is(err, define.ErrDetach)` appears character-identically in 3 files — REDACTED, pkg/api/handlers/compat/exec.go, pkg/domain/infra/abi/containers.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 libpod/runtime_ctr.go:1460— `err != nil && !errors.Is(err, define.ErrNoSuchCtr)` appears character-identically in 3 files — libpod/runtime_ctr.go, pkg/domain/infra/abi/containers.go, pkg/domain/infra/abi/play.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/api/handlers/libpod/pods.go:215— `err != nil && !errors.Is(err, define.ErrPodPartialFail)` appears character-identically in 3 files — pkg/api/handlers/libpod/pods.go, pkg/domain/infra/abi/play.go, pkg/domain/infra/abi/pods.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/podman/root.go:478— `err != nil && !errors.Is(err, fs.ErrNotExist)` appears character-identically in 2 files — cmd/podman/root.go, libpod/oci_conmon_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libpod/container_internal.go:1885— `err != nil && !errors.Is(err, os.ErrExist)` appears character-identically in 2 files — libpod/container_internal.go, libpod/container_internal_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:2969— `err != nil && !errors.Is(err, os.ErrNotExist)` appears character-identically in 3 files — REDACTED, pkg/lookup/lookup.go, pkg/machine/ocipull/ociartifact.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/api/handlers/compat/images.go:165— `err != nil && !strings.Contains(err.Error(), "is not running")` appears character-identically in 2 files — pkg/api/handlers/compat/images.go, pkg/api/handlers/libpod/images.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 libpod/container_internal.go:1889— `err == nil && (rootUID != 0 || rootGID != 0)` appears character-identically in 2 files — libpod/container_internal.go, libpod/container_internal_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libpod/container_validate.go:214— `err == nil && imageRef.Transport().Name() != docker.Transport.Name()` appears character-identically in 2 files — libpod/container_validate.go, pkg/api/handlers/utils/images.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/podman-mac-helper/service.go:74— `err == nil || errors.Is(err, os.ErrNotExist)` appears character-identically in 2 files — cmd/podman-mac-helper/service.go, 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 libpod/pod.go:477— `errors.Is(err, define.ErrCtrStateInvalid) || errors.Is(err, define.ErrCtrStopped)` appears character-identically in 3 files — libpod/pod.go, libpod/pod_api.go, pkg/api/handlers/compat/containers.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 libpod/container_api.go:635— `errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved)` appears character-identically in 8 files — libpod/container_api.go, REDACTED, libpod/container_internal.go, libpod/reset.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 libpod/container_internal.go:607— `errors.Is(err, storage.ErrNotAContainer) || errors.Is(err, storage.ErrContainerUnknown)` appears character-identically in 3 files — libpod/container_internal.go, libpod/runtime_cstorage.go, libpod/storage.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/specgen/generate/oci_freebsd.go:124— `len(compatibleOptions.HostDeviceList) > 0 && len(s.Devices) == 0` appears character-identically in 2 files — pkg/specgen/generate/oci_freebsd.go, pkg/specgen/generate/oci_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/domain/infra/runtime_libpod.go:245— `len(gidMapSlice) == 0 && len(uidMapSlice) != 0` appears character-identically in 2 files — pkg/domain/infra/runtime_libpod.go, 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 cmd/podman/parse/net.go:150— `len(line) > 0 && !strings.HasPrefix(line, "#")` appears character-identically in 2 files — cmd/podman/parse/net.go, pkg/env/env.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/domain/infra/runtime_libpod.go:248— `len(uidMapSlice) == 0 && len(gidMapSlice) != 0` appears character-identically in 2 files — pkg/domain/infra/runtime_libpod.go, 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 libpod/stats_freebsd.go:104— `memLimit <= 0 || memLimit > physicalLimit` appears character-identically in 2 files — libpod/stats_freebsd.go, libpod/stats_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libpod/runtime_ctr.go:128— `newName == "" || !define.NameRegex.MatchString(newName)` appears character-identically in 2 files — libpod/runtime_ctr.go, libpod/runtime_volume.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.
Silent fallback default on error cmd/podman/machine/list.go:143— `strTime` 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 libpod/pod.go:223— `BlkiThrottleReadBps` turns a non-nil `err` into `return []define.InspectBlkioThrottleDevice{}` — 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 libpod/pod.go:236— `BlkiThrottleWriteBps` turns a non-nil `err` into `return []define.InspectBlkioThrottleDevice{}` — 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 libpod/pod.go:245— `NetworkMode` 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 libpod/pod.go:254— `NamespaceMode` 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 1 significant file(s) lose their only recent owner: pkg/domain/utils/scp_compression.go. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 8 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 (9 single-owned of 502 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 502 of the 985 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) (+2 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: pkg/domain/infra/abi/trust.go, pkg/systemd/notifyproxy/notifyproxy.go, pkg/bindings/manifests/types.go, libpod/networking_machine.go, pkg/bindings/connection_stdio.go, cmd/podman/system/dial_stdio.go, pkg/specgen/utils_linux.go, pkg/api/handlers/compat/distribution.go.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (165913 LoC, 1032 module-visible types across 162 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 41 of 502 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 502 of the 985 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: pkg/domain/infra/abi/containers_runlabel.go, pkg/systemd/parser/split.go, cmd/podman/system/connection/add.go, libpod/service.go, pkg/api/server/register_pods.go, pkg/emulation/elf.go, REDACTED, cmd/podman/containers/rm.go (and 33 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
DM2 · Strongly-typed ids· Primitive id on a domain type · ×1
Primitive id on a domain type: PruneReport.Id pkg/domain/entities/reports/prune.go:10— `PruneReport.Id` is a raw `string` — give it a strongly-typed id: a dedicated single-field type wrapping the `string`, in whatever form your language spells that.
README/code drift test/README.md:133— test/README.md documents the environment variable `PODMAN_DB`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
X2 · Cancellation propagation· Not all functions that make a request accept a context.Context · ×1
Not all functions that make a request accept a context.Context — Only 5/18 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.
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
Outdated: github.com/kevinburke/ssh_config — `github.com/kevinburke/ssh_config` is required at v1.5.0 in REDACTED, but v1.6.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/kevinburke/ssh_config@v1.6.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a16be6-7ef0-7ed7-bbfa-ec2c2398ebfb · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 18 · Warnings: 1535 · Recommendations: 121 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 24-10-2026 @ 03:13 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.