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

podman-container-tools/podman

Measured 13 November 2026, 13:10 UTC, at code version c1d4564

CAI score 58out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Down 2 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: 167,845 lines of product code in 2 projects, tests not counted · Estimated rebuild effort: about 2.5 person-years · Weakest lens: Code Health, 50

Findings by how serious they are

19 critical 1802 serious 129 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
13 November 2026, 13:10 UTC

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

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

56of 56 dimensions measured by tools.
1933of 1950 findings point to an exact file and line, so you can open each one in the code. The other 17 concern the repository as a whole, such as missing documentation.
56dimensions across 7 lenses, read from 167,845 lines of product code in 2 projects.
Chapters

Executive summary

podman-container-tools/podman falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 58 out of 100 and is rated Adequate, and 18 of its 19 critical findings are security problems.

Code Health, at 50, is the weakest lens and counts most in the score. The best first step is adopting a type checker, worth about 5 points. Simplifying the hardest methods would lift Code Health itself, worth about 3 points. Raising Code Health to 70 would lift the score to about 63.

Six passwords or keys are open to anyone who can read the repository. Six pipeline steps run downloads nobody checks, and two places in the code run text as code, which an attacker could use. Replacing each exposed password or key, checking each download against a checksum and replacing text run as code with direct calls would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and the two unsafe settings in infrastructure or container files need changing to safe values. The set of files in separate parts that keep changing together needs that dependency made explicit.

The product code is 167,845 lines, about €360,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 50 · counts for 46%Security and Compliance 56 · counts for 25%Domain Modelling 60 · counts for 14%Production Readiness 74 · counts for 8%Architecture 81 · counts for 4%Maturity 92 · counts for 2%Performance 95 · counts for 1%

If Code Health rose from 50 to 70, the lowest score rated Strong, the score would rise from 58 to about 63.

Code composition: what the lines of code are
Product code 66%Tests 34%
New since the last survey: 338 findings

These 338 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · tunnel.parseBuildOutput (cyclomatic 18) REDACTED
  • Cyclomatic Complexity · farm.rm (cyclomatic 17) cmd/podman/farm/remove.go
  • Cyclomatic Complexity · libpod.readConmonPipeData (cyclomatic 17) REDACTED
  • Cyclomatic Complexity · ContainerEngine.buildImageFromContainerfile (cyclomatic 16) pkg/domain/infra/abi/play.go
  • Cognitive Complexity · tunnel.parseBuildOutput (cognitive 28) REDACTED
  • Cognitive Complexity · quadlet.translateUnitDependencies (cognitive 28) pkg/systemd/quadlet/quadlet.go
  • Cognitive Complexity · ContainerEngine.buildImageFromContainerfile (cognitive 25) pkg/domain/infra/abi/play.go
  • Cognitive Complexity · ImageEngine.handleBuildOutputs (cognitive 24) REDACTED
  • Cognitive Complexity · containers.validateStart (cognitive 18) cmd/podman/containers/start.go
  • Cognitive Complexity · utils.WaitContainerLibpod (cognitive 17) pkg/api/handlers/utils/containers.go
  • Cognitive Complexity · Container.moveToConmonCgroup (cognitive 16) libpod/conmon_cgroup_linux.go
  • Cognitive Complexity · libpod.ExportImageRootfs (cognitive 16) pkg/api/handlers/libpod/images.go
  • God Classes · TooManyMethods: Container libpod/container.go
  • God Classes · FunctionTooLong: common.DefineCreateFlags cmd/podman/common/create.go
  • God Classes · TooManyMethods: Runtime libpod/runtime.go
  • God Classes · TooManyFields: ContainerCreateOptions pkg/domain/entities/pods.go
  • God Classes · TooManyMethods: ContainerEngine pkg/domain/infra/abi/runtime.go
  • God Classes · FunctionTooLong: specgenutil.FillOutSpecGen pkg/specgenutil/specgen.go
  • God Classes · MethodTooLong: Container.generateSpec REDACTED
  • God Classes · MethodTooLong: ContainerEngine.playKubePod pkg/domain/infra/abi/play.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · TooManyMethods: ContainerEngine pkg/domain/infra/tunnel/runtime.go
  • God Classes · FunctionTooLong: compat.createBuildOptions pkg/api/handlers/compat/images_build.go
  • God Classes · FileTooLong: quadlet/quadlet.go pkg/systemd/quadlet/quadlet.go
  • God Classes · TooManyFields: BuildQuery pkg/api/handlers/compat/images_build.go
  • God Classes · FileTooLong: libpod/container_internal.go libpod/container_internal.go
  • God Classes · ClassTooLong: SQLiteState libpod/sqlite_state.go
  • God Classes · FunctionTooLong: common.buildFlagsWrapperToOptions cmd/podman/common/build.go
  • God Classes · FunctionTooLong: kube.ToSpecGen pkg/specgen/generate/kube/kube.go
  • God Classes · FunctionTooLong: compat.cliOpts pkg/api/handlers/compat/containers_create.go
  • God Classes · FunctionTooLong: images.prepareParams REDACTED
  • God Classes · FileTooLong: libpod/sqlite_state.go libpod/sqlite_state.go
  • God Classes · FileTooLong: abi/play.go pkg/domain/infra/abi/play.go
  • God Classes · FunctionTooLong: generate.createContainerOptions pkg/specgen/generate/container_create.go
  • God Classes · TooManyMethods: Pod libpod/pod.go
  • God Classes · FileTooLong: abi/containers.go pkg/domain/infra/abi/containers.go
  • God Classes · TooManyFields: InspectContainerHostConfig libpod/define/container_inspect.go
  • God Classes · MethodTooLong: Container.restore REDACTED
  • God Classes · FileTooLong: common/completion.go cmd/podman/common/completion.go
  • God Classes · MethodTooLong: ContainerEngine.PlayKube pkg/domain/infra/abi/play.go
  • God Classes · MethodTooLong: Runtime.setupContainer libpod/runtime_ctr.go
  • God Classes · FileTooLong: libpod/options.go libpod/options.go
  • God Classes · TooManyMethods: SQLiteState libpod/sqlite_state.go
  • God Classes · FunctionTooLong: quadlet.ConvertContainer pkg/systemd/quadlet/quadlet.go
  • God Classes · FunctionTooLong: filters.GenerateContainerFilterFuncs pkg/domain/filters/containers.go
  • God Classes · FunctionTooLong: generate.namespaceOptions pkg/specgen/generate/namespaces.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · FunctionTooLong: generate.MakeContainer pkg/specgen/generate/container_create.go
  • God Classes · MethodTooLong: Runtime.removeContainer libpod/runtime_ctr.go
  • God Classes · MethodTooLong: Container.platformInspectContainerHostConfig libpod/container_inspect_linux.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · FunctionTooLong: libpod.makeRuntime libpod/runtime.go
  • God Classes · FileTooLong: compat/images_build.go pkg/api/handlers/compat/images_build.go
  • God Classes · FunctionTooLong: compat.PushImage pkg/api/handlers/compat/images_push.go
  • God Classes · FileTooLong: specgenutil/specgen.go pkg/specgenutil/specgen.go
  • God Classes · FileTooLong: kube/kube.go pkg/specgen/generate/kube/kube.go
  • God Classes · FunctionTooLong: libpod.ImagesPull pkg/api/handlers/libpod/images_pull.go
  • God Classes · FunctionTooLong: libpod.ManifestModify pkg/api/handlers/libpod/manifests.go
  • God Classes · FunctionTooLong: compat.LibpodToContainerJSON pkg/api/handlers/compat/containers.go
  • God Classes · FunctionTooLong: generate.SpecGenToOCI pkg/specgen/generate/oci_linux.go
  • God Classes · ClassTooLong: ConmonOCIRuntime REDACTED
  • God Classes · FileTooLong: common/create.go cmd/podman/common/create.go
  • God Classes · TooManyMethods: ImageEngine pkg/domain/infra/abi/runtime.go
  • God Classes · TooManyFields: ContainerMiscConfig libpod/container_config.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · FileTooLong: libpod/runtime.go libpod/runtime.go
  • God Classes · TooManyMethods: ImageEngine pkg/domain/infra/tunnel/runtime.go
  • God Classes · MethodTooLong: ConmonOCIRuntime.createOCIContainer REDACTED
  • God Classes · FileTooLong: libpod/runtime_ctr.go libpod/runtime_ctr.go
  • God Classes · FunctionTooLong: generate.ConfigToSpec pkg/specgen/generate/container.go
  • God Classes · FunctionTooLong: util.processOptionsInternal pkg/util/mount_opts.go
  • God Classes · TooManyMethods: ConmonOCIRuntime REDACTED
  • God Classes · FunctionTooLong: specgenutil.parseMountOptions pkg/specgenutil/volumes.go
  • God Classes · FileTooLong: tunnel/containers.go pkg/domain/infra/tunnel/containers.go
  • God Classes · TooManyFields: InspectContainerData libpod/define/container_inspect.go
  • God Classes · ClassTooLong: Container libpod/container.go
  • God Classes · FileTooLong: libpod/container.go libpod/container.go
  • God Classes · TooManyFields: ContainerBasicConfig pkg/specgen/specgen.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · FunctionTooLong: utils.ExecuteTransfer pkg/domain/utils/scp.go
  • God Classes · FunctionTooLong: shim.startLocked pkg/machine/shim/host.go
  • God Classes · FileTooLong: abi/images.go pkg/domain/infra/abi/images.go
  • God Classes · FunctionTooLong: shim.Init pkg/machine/shim/host.go
  • God Classes · FunctionTooLong: filters.GenerateExternalContainerFilterFuncs pkg/domain/filters/containers.go
  • God Classes · FunctionTooLong: generate.executeContainerTemplate pkg/systemd/generate/containers.go
  • God Classes · FileTooLong: REDACTED REDACTED
  • God Classes · MethodTooLong: Container.getContainerInspectData libpod/container_inspect.go
  • God Classes · FunctionTooLong: generate.ParsePortMapping pkg/specgen/generate/ports.go
  • God Classes · MethodTooLong: ConmonOCIRuntime.HTTPAttach REDACTED
  • God Classes · FunctionTooLong: compat.LibpodToContainer pkg/api/handlers/compat/containers.go
  • God Classes · FunctionTooLong: main.rootFlags cmd/podman/root.go
  • God Classes · FunctionTooLong: generate.CompleteSpec pkg/specgen/generate/container.go
  • God Classes · FileTooLong: compat/containers.go pkg/api/handlers/compat/containers.go
  • God Classes · TooManyMethods: UnitFile pkg/systemd/parser/unitfile.go
  • God Classes · TooManyFields: InspectContainerConfig libpod/define/container_inspect.go
  • God Classes · TooManyFields: HostInfo libpod/define/info.go
  • God Classes · TooManyFields: PodmanConfig pkg/domain/entities/engine.go
  • God Classes · FileTooLong: libpod/container_api.go libpod/container_api.go
  • God Classes · TooManyFields: PlayKubeOptions pkg/domain/entities/play.go
  • God Classes · MethodTooLong: Pod.Inspect libpod/pod_api.go

We compare 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: 114 findings

These 114 critical or serious findings were in the previous survey, on 24 October 2026, and are gone from this one. The first 100 are listed here.

  • Cognitive Complexity · Container.unpause (cognitive 16) libpod/container_internal.go
  • Code Duplication · Edited copy of a member (29 corresponding lines) libpod/sqlite_state.go
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) pkg/api/handlers/compat/containers.go
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) pkg/api/handlers/compat/containers.go
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) libpod/container_api.go
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/api/handlers/compat/containers_pause.go
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/api/handlers/libpod/artifacts.go
  • Code Duplication · Duplicated block (18–19 lines × 2) libpod/boltdb_state_internal.go
  • Code Duplication · Duplicated block (16–17 lines × 2) libpod/boltdb_state_internal.go
  • Code Duplication · Duplicated block (13–14 lines × 2) pkg/domain/infra/abi/containers.go
  • Code Duplication · Duplicated block (12 lines × 2) pkg/specgen/generate/storage.go
  • Code Duplication · Duplicated block (7–8 lines × 2) REDACTED
  • Code Duplication · Duplicated block (8 lines × 2) REDACTED
  • Code Duplication · Duplicated block (10 lines × 5) cmd/podman/images/exists.go
  • Code Duplication · Duplicated block (11 lines × 2) libpod/runtime_pod_common.go
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: pkg/bindings/manifests/manifests.go pkg/bindings/manifests/manifests.go
  • Churn × Complexity Hotspots · Hotspot: libpod/networking_common.go libpod/networking_common.go
  • Churn × Complexity Hotspots · Hotspot: REDACTED REDACTED
  • Churn × Complexity Hotspots · Hotspot: pkg/machine/hyperv/stubber.go pkg/machine/hyperv/stubber.go
  • Churn × Complexity Hotspots · Hotspot: cmd/podman/system/service_abi.go cmd/podman/system/service_abi.go
  • Churn × Complexity Hotspots · Hotspot: cmd/podman/manifest/add.go cmd/podman/manifest/add.go
  • Churn × Complexity Hotspots · Repeated repair: libpod/define/container_inspect.go libpod/define/container_inspect.go
  • Explicit Debt · TodoComment libpod/runtime_ctr.go
  • Explicit Debt · TodoComment libpod/runtime_ctr.go
  • Explicit Debt · TodoComment libpod/oci_conmon_linux.go
  • Explicit Debt · TodoComment libpod/oci_conmon_exec_common.go
  • Explicit Debt · FixmeComment REDACTED
  • Explicit Debt · TodoComment pkg/k8s.io/api/apps/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/apps/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/apps/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/apps/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/apps/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/api/core/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/scale_int.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/quantity.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/api/resource/amount.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/apis/meta/v1/types.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/util/intstr/intstr.go
  • Explicit Debt · TodoComment pkg/k8s.io/apimachinery/pkg/util/intstr/intstr.go
  • Static Analysis (SAST) · Medium: REDACTED libpod/runtime_pre_go1.20.go
  • Dependency Vulnerabilities · Medium vulnerability: GO-2026-5932 REDACTED
  • Change Coupling · Change coupling: config.go ↔ machine.go pkg/machine/applehv/config.go
  • Change Coupling · Change coupling: vfkit.go ↔ helper.go pkg/machine/apple/vfkit.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/common/completion.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/common/completion.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/common/completion.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/machine/machine.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/machine/machine.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/machine/list.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/podman/utils/utils.go
  • Exception handling · Swallowed exception (caught, then discarded) cmd/quadlet/main.go
  • Exception handling · Swallowed exception (caught, then discarded) REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) libpod/stats_linux.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/sqlite_state_internal.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/runtime.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/runtime.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/pod.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/pod.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/pod.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/pod.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) libpod/networking_linux.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/info.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_path_resolution.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_linux.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_linux.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_linux.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_freebsd.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_freebsd.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_internal_freebsd.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_api.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container_api.go
  • Exception handling · Swallowed exception (caught, then discarded) libpod/container.go
Rebuild cost: about €360,000 · Estimate
Cost to rebuild€120,000 to €600,000, for 1,987 to 6,303 hours of work, about 2.5 person-years for 1 to 5 engineers
Difficulty of the problemHigh, 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 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 167,845 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
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.
Raises the score by about 5 points · Medium effort · Nullable reference types
2
Bring the 199 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 249), ContainerEngine.playKubePod (cognitive 231).
Raises the score by about 3 points · High effort · Cognitive Complexity
3
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 2 points · Low effort · Secrets (history)

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €360,000 to build again, about 2.5 person-years of work. Its weakest lens is Code Health, at 50 (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 5 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 we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 29,172 lines over the last 90 days, which is about 118,309 lines a year. At that pace, the extra work comes to an estimated 18 to 108.3 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

165 modules, with 217 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; 125 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 io/podman/v6/internal/domain/entities2 io/podman/v6/libpod/define3 io/podman/v6/libpod/events4 io/podman/v6/libpod/lock5 io/podman/v6/pkg/domain/entities/reports6 io/podman/v6/pkg/logiface7 io/podman/v6/pkg/machine/define8 io/podman/v6/cmd/quadlet9 io/podman/v6/pkg/machine/ignition10 io/podman/v6/pkg/machine/qemu/command11 io/podman/v6/pkg/specgen12 io/podman/v6/pkg/domain/entities/types13 io/podman/v6/pkg/machine/vmconfigs14 io/podman/v6/cmd/podman/utils15 io/podman/v6/internal/localapi16 io/podman/v6/pkg/bindings/images17 io/podman/v6/pkg/bindings/kube18 io/podman/v6/pkg/domain/entities19 io/podman/v6/pkg/machine20 io/podman/v6/pkg/machine/hyperv21 io/podman/v6/pkg/machine/qemu22 io/podman/v6/pkg/machine/wsl23 io/podman/v6/cmd/podman24 io/podman/v6/cmd/podman/common25 io/podman/v6/cmd/podman/machine26 io/podman/v6/cmd/podman/pods27 io/podman/v6/cmd/podman/system28 io/podman/v6/libpod29 io/podman/v6/pkg/api/handlers30 io/podman/v6/pkg/api/handlers/swagger31 io/podman/v6/pkg/machine/shim32 io/podman/v6/cmd/podman/containers33 io/podman/v6/cmd/podman/images34 io/podman/v6/pkg/api/handlers/libpod35 io/podman/v6/pkg/api/server36 io/podman/v6/pkg/bindings/containers37 io/podman/v6/pkg/domain/infra38 io/podman/v6/pkg/domain/infra/abi39 io/podman/v6/pkg/domain/infra/tunnel40 io/podman/v6/pkg/api/handlers/compat
1 io/podman/v6/internal/domain/entities
2 io/podman/v6/libpod/define
3 io/podman/v6/libpod/events
4 io/podman/v6/libpod/lock
5 io/podman/v6/pkg/domain/entities/reports
6 io/podman/v6/pkg/logiface
7 io/podman/v6/pkg/machine/define
8 io/podman/v6/cmd/quadlet1
9 io/podman/v6/pkg/machine/ignition2
10 io/podman/v6/pkg/machine/qemu/command4
11 io/podman/v6/pkg/specgen2
12 io/podman/v6/pkg/domain/entities/types612
13 io/podman/v6/pkg/machine/vmconfigs1221
14 io/podman/v6/cmd/podman/utils12
15 io/podman/v6/internal/localapi112
16 io/podman/v6/pkg/bindings/images29
17 io/podman/v6/pkg/bindings/kube2
18 io/podman/v6/pkg/domain/entities523580
19 io/podman/v6/pkg/machine1116
20 io/podman/v6/pkg/machine/hyperv426
21 io/podman/v6/pkg/machine/qemu7213
22 io/podman/v6/pkg/machine/wsl524
23 io/podman/v6/cmd/podman114
24 io/podman/v6/cmd/podman/common18
25 io/podman/v6/cmd/podman/machine2126
26 io/podman/v6/cmd/podman/pods2112
27 io/podman/v6/cmd/podman/system1392
28 io/podman/v6/libpod651051531
29 io/podman/v6/pkg/api/handlers1
30 io/podman/v6/pkg/api/handlers/swagger63342
31 io/podman/v6/pkg/machine/shim457
32 io/podman/v6/cmd/podman/containers413271
33 io/podman/v6/cmd/podman/images3152
34 io/podman/v6/pkg/api/handlers/libpod111
35 io/podman/v6/pkg/api/server11
36 io/podman/v6/pkg/bindings/containers42191
37 io/podman/v6/pkg/domain/infra41
38 io/podman/v6/pkg/domain/infra/abi3337314611
39 io/podman/v6/pkg/domain/infra/tunnel341741341
40 io/podman/v6/pkg/api/handlers/compat412321
Uses a module listed above itPart of a loopThe module itself
1 io/podman/v6/internal/domain/entities2 io/podman/v6/libpod/define3 io/podman/v6/libpod/events4 io/podman/v6/libpod/lock5 io/podman/v6/pkg/domain/entities/reports6 io/podman/v6/pkg/logiface7 io/podman/v6/pkg/machine/define8 io/podman/v6/cmd/quadlet9 io/podman/v6/pkg/machine/ignition10 io/podman/v6/pkg/machine/qemu/command11 io/podman/v6/pkg/specgen12 io/podman/v6/pkg/domain/entities/types13 io/podman/v6/pkg/machine/vmconfigs14 io/podman/v6/cmd/podman/utils15 io/podman/v6/internal/localapi16 io/podman/v6/pkg/bindings/images17 io/podman/v6/pkg/bindings/kube18 io/podman/v6/pkg/domain/entities19 io/podman/v6/pkg/machine20 io/podman/v6/pkg/machine/hyperv21 io/podman/v6/pkg/machine/qemu22 io/podman/v6/pkg/machine/wsl23 io/podman/v6/cmd/podman24 io/podman/v6/cmd/podman/common25 io/podman/v6/cmd/podman/machine26 io/podman/v6/cmd/podman/pods27 io/podman/v6/cmd/podman/system28 io/podman/v6/libpod29 io/podman/v6/pkg/api/handlers30 io/podman/v6/pkg/api/handlers/swagger31 io/podman/v6/pkg/machine/shim32 io/podman/v6/cmd/podman/containers33 io/podman/v6/cmd/podman/images34 io/podman/v6/pkg/api/handlers/libpod35 io/podman/v6/pkg/api/server36 io/podman/v6/pkg/bindings/containers37 io/podman/v6/pkg/domain/infra38 io/podman/v6/pkg/domain/infra/abi39 io/podman/v6/pkg/domain/infra/tunnel40 io/podman/v6/pkg/api/handlers/compatio/podman/v6/internal/domain/entities1io/podman/v6/libpod/define2io/podman/v6/libpod/events3io/podman/v6/libpod/lock4io/podman/v6/pkg/domain/entities/reports5io/podman/v6/pkg/logiface6io/podman/v6/pkg/machine/define7io/podman/v6/cmd/quadlet8io/podman/v6/pkg/machine/ignition9io/podman/v6/pkg/machine/qemu/command10io/podman/v6/pkg/specgen11io/podman/v6/pkg/domain/entities/types12io/podman/v6/pkg/machine/vmconfigs13io/podman/v6/cmd/podman/utils14io/podman/v6/internal/localapi15io/podman/v6/pkg/bindings/images16io/podman/v6/pkg/bindings/kube17io/podman/v6/pkg/domain/entities18io/podman/v6/pkg/machine19io/podman/v6/pkg/machine/hyperv20io/podman/v6/pkg/machine/qemu21io/podman/v6/pkg/machine/wsl22io/podman/v6/cmd/podman23io/podman/v6/cmd/podman/common24io/podman/v6/cmd/podman/machine25io/podman/v6/cmd/podman/pods26io/podman/v6/cmd/podman/system27io/podman/v6/libpod28io/podman/v6/pkg/api/handlers29io/podman/v6/pkg/api/handlers/swagger30io/podman/v6/pkg/machine/shim31io/podman/v6/cmd/podman/containers32io/podman/v6/cmd/podman/images33io/podman/v6/pkg/api/handlers/libpod34io/podman/v6/pkg/api/server35io/podman/v6/pkg/bindings/containers36io/podman/v6/pkg/domain/infra37io/podman/v6/pkg/domain/infra/abi38io/podman/v6/pkg/domain/infra/tunnel39io/podman/v6/pkg/api/handlers/compat401242612122112112292523580111642672135241141821262112139265105153116334245741327131521111142191413337314611341741341412321+125 more modules (most-connected shown)

At a glance — Code Health · 50% · Adequate · gated by D1, D2, X5 ·

At a glance — Architecture · 81% · Adequate · gated by D26 ·

At a glance — Maturity · 92% · Exemplary ·

At a glance — Readiness · 74% · Adequate · gated by P7 ·

At a glance — Security · 56% · Adequate · gated by D28, D29 ·

At a glance — Domain Modelling · 60% · Adequate · gated by DM2, DM5 ·

At a glance — Performance · 95% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection75High / Critical
A07:2025 — Authentication Failures7High / Critical
A03:2025 — Software Supply Chain Failures7Medium
A02:2025 — Security Misconfiguration5High / Critical

Roadmap

Top priorities: 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 199 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 249), ContainerEngine.playKubePod (cognitive 231); Thread a context.Context through functions that make requests, so the work stops when its caller gives up.

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

Do thisHelpsEffortDimension
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.+4.7 ptsMediumNullable reference types
Bring the 199 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 249), ContainerEngine.playKubePod (cognitive 231).+3.3 ptsHighCognitive Complexity
Resolve the 4 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED, REDACTED.+1.5 ptsLowSecrets (history)
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.+2.8 ptsMediumCancellation propagation
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).+2.4 ptsMediumEncapsulated state
Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with specgenutil.FillOutSpecGen (cyclomatic 208), Container.generateSpec (cyclomatic 157), ContainerEngine.playKubePod (cyclomatic 129).+2.3 ptsHighCyclomatic Complexity
Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.+1.9 ptsMediumStrongly-typed ids
Resolve the 2 High secret finding(s) in Secrets (history) — start with REDACTED (2).+0.9 ptsLowSecrets (history)

File quality

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

FileScoreBandWorst signal
cmd/podman/kube/play.go3.4SlopChange Coupling: Boundary-crossing change coupling: play.go ↔ types.go
REDACTED3.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedIaC & Container Security: High IaC: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
pkg/domain/infra/abi/runtime.go5.5MixedGod Classes: TooManyMethods: ContainerEngine

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 — 19

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 — 1802

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 — 129

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

Could not be resolved — 20

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

Methodology & how to trust this report

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

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 56 dimensions across the health lenses
D1D2D3D4D6D7D12D13D14D15D16D17D19D20D26D27D28D29D30D31D34D35D36D37D43D44AX10AX2AX3AX5DM1DM11DM12DM2DM4DM5DM6DM7DM9M1M2M3M4P1P2P3P4P6P7PF1X14X2X26X28X3X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1933 of 1950 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a1d508-19df-741d-b260-574130c620ce.

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

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a 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.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (vendor/go.opentelemetry.io/otel/dependencies.Dockerfile). the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence).
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • DM8 Value-object opportunities — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds primitive parameters that travel together through several signatures of the domain (a missing value object). Its deterministic rule has not yet shown 95 % precision on adjudicated rows, so the clumps it finds are counted here and not published as findings, and the card carries no score. That is a limit of the analyzer, not a finding about your code.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
  • ED5 Idempotency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

308 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was specgenutil.FillOutSpecGen at 208. 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.

specgenutil.FillOutSpecGen (cyclomatic 208)pkg/specgenutil/specgen.go:334
Container.generateSpec (cyclomatic 157)REDACTED:235
ContainerEngine.playKubePod (cyclomatic 129)pkg/domain/infra/abi/play.go:737
images.prepareParams (cyclomatic 118)REDACTED:135
generate.createContainerOptions (cyclomatic 111)pkg/specgen/generate/container_create.go:389

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

What to do

  1. Bring the 23 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with specgenutil.FillOutSpecGen (cyclomatic 208), 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.

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

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

482 method(s) exceeded the cognitive complexity threshold of 15; the worst was Container.generateSpec at 329.

Container.generateSpec (cognitive 329)REDACTED:235
specgenutil.FillOutSpecGen (cognitive 249)pkg/specgenutil/specgen.go:334
ContainerEngine.playKubePod (cognitive 231)pkg/domain/infra/abi/play.go:737
Runtime.setupContainer (cognitive 208)libpod/runtime_ctr.go:245
Container.restore (cognitive 193)REDACTED:1696

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

What to do

  1. Bring the 199 bodies over 30 down to 30 or less in Cognitive Complexity — start with Container.generateSpec (cognitive 329), specgenutil.FillOutSpecGen (cognitive 249), 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 199 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.

D3 · God Classes7.6 / 10Strong✓ Tool-verified

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

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

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

132 god class(es) detected.

FunctionTooLong: common.DefineCreateFlags · ×49cmd/podman/common/create.go:33
FileTooLong: REDACTED · ×31REDACTED
MethodTooLong: Container.generateSpec · ×20REDACTED:235
TooManyFields: ContainerCreateOptions · ×15pkg/domain/entities/pods.go:139
TooManyMethods: Container · ×13libpod/container.go:96

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

What to do

  1. Resolve the 49 FunctionTooLong finding(s) in God Classes — start with containers.go (5), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 31 FileTooLong finding(s) in God Classes — start with containers.go (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (31 warning-level).
  3. Resolve the 20 MethodTooLong finding(s) in God Classes — start with REDACTED (3), play.go (3), runtime_ctr.go (2). — One of this dimension's main actionable groups (20 warning-level).

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

D4 · Code Duplication9.1 / 10Stronggated by 498 serious findings✓ Tool-verified

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.

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

311 duplicated block group(s) detected. A further 187 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.

Duplicated block (10 lines × 2) · ×32cmd/podman/artifact/pull.go:103
Duplicated block (8 lines × 2) · ×28libpod/container_internal.go:1113
Duplicated block (11 lines × 2) · ×27cmd/podman/artifact/push.go:55
Duplicated block (9 lines × 2) · ×23cmd/podman/common/completion.go:159
Duplicated block (13 lines × 2) · ×15cmd/podman/containers/mount.go:105

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

What to do

  1. 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).
  2. Resolve the 28 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (5), REDACTED (3), volumes.go (2). — One of this dimension's main actionable groups (28 warning-level).
  3. 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).

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

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

5 of 71 classes have LCOM4 above 3.

Low cohesion: ContainerEngine (LCOM4 8) · ×5pkg/domain/infra/abi/runtime.go:18

What to do

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

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

D7 · Architectural Integrity6.0 / 10Adequate✓ Tool-verified

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.

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

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D12 · Dependency Hygiene9.6 9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 95% · ceiling Verified

4 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 · ×4

What to do

  1. Resolve the 1 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).

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

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 181 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

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

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: REDACTED (13×157=2041); pkg/specgenutil/specgen.go (6×208=1248); cmd/podman/common/build.go (9×96=864)

Hotspot: REDACTED · ×36REDACTED:235

What to do

  1. Resolve the 36 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 (36 warning-level).

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

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.

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

10 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 498 of the 979 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.

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

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

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

TodoComment · ×191test/e2e/artifact_test.go:230
FixmeComment · ×47test/utils/matchers.go:142
XxxComment · ×3pkg/systemd/quadlet/quadlet.go:1015
HackComment · ×2REDACTED:644

What to do

  1. Resolve the 191 TodoComment finding(s) in Explicit Debt — start with specgen.go (10), machine.go (8), container_inspect.go (8). — One of this dimension's main actionable groups (191 warning-level).
  2. Resolve the 47 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 (47 warning-level).
  3. 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).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 485 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

0 of 6 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

1 of 2 build units (Go, Python) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

D27 · Navigability9.4 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

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.

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

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

  1. 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).
  2. 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).
  3. 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.

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

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

75 finding(s): 0 critical, 10 high, 29 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

  1. 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).
  2. 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).
  3. 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.

D30 · Dependency Vulnerabilities9.8 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

1 finding(s): 0 critical, 0 high, 1 medium, 0 low.

REDACTED

What to do

  1. Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D31 · IaC & Container Security9.1 8.1 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

5 finding(s): 0 critical, 2 high, 2 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. 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).
  2. 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).
  3. 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.

D34 · Knowledge Freshness9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

39 of 498 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 498 of the 979 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×39pkg/api/server/register_pods.go:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.9 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

Strongest change-coupling: types.go↔play.go 80%; types.go↔REDACTED 80%; config.go↔machine.go 75%

Boundary-crossing change coupling: play.go ↔ types.gocmd/podman/kube/play.go:1
Change coupling: types.go ↔ REDACTED · ×3pkg/bindings/images/types.go:1
Change-coupling hub: types.go → register_kube.go, play.go, play.gopkg/bindings/kube/types.go

What to do

  1. Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with play.go. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 3 Change coupling finding(s) in Change Coupling — start with types.go, config.go, container_config.go. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with types.go. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. 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).
  2. 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).
  3. 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.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

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.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition8.1 / 10Strong✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

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

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

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

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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.

DM1 · Aggregate boundaries10.0 / 10Exemplary✓ Tool-verified

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.

DM11 · Constructible invalid state10.0 / 10Exemplary○ Nothing flagged

Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.

Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule / an XException.ThrowIf* helper). C#: a static factory beside a public constructor does not exempt it, and a public parameterless constructor followed by public raw-primitive setters that refuse nothing is charged when the type also declares a validating way in (a guarded constructor or a guarding static method returning the type); TypeScript: a static Create/Of/From/New factory exempts the type. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.

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.

DM2 · Strongly-typed ids3.0 / 10Weak✓ Tool-verified

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
  • `SecretRmReport.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/types/secrets.go:37

What to do

  • Adopt strongly-typed ids across the domain — finish the migration or document the boundary; primitive ids invite transposed-argument bugs.
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.

DM5 · Encapsulated state1.0 / 10Critical✓ Tool-verified

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).
DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

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.

DM7 · Repository granularity10.0 / 10Exemplary✓ Tool-verified

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.

DM9 · Scattered domain decisions10.0 / 10Exemplary✓ Tool-verified

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.

M1 · Documentation (README)8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

M2 · Architecture documentation10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P2 · Observability10.0 / 10Exemplary○ Nothing flagged

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

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

P3 · Security & performance tooling9.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

What to do

  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • 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.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

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

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `http.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:451, 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.
PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

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

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

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation5.7 / 10Adequate✓ Tool-verified

Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 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.
  • `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
  • `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
  • `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
  • `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
  • `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
  • `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
  • `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
  • `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
  • `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
  • `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:448

What to do

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

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

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

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

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

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

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×34) — pkg/systemd/quadlet/unitdirs.go:216, pkg/systemd/parser/unitfile.go:687, pkg/specgen/generate/container.go:633, …
  • `if err = cmd.Start(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/machine/wsl/wutil/wutil.go:74
  • `if nil != err` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×2) — REDACTED:28, REDACTED:32
  • `if fileErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:277
  • `if err := qmpMonitor.Disconnect(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/machine/qemu/machine.go:200
  • `if err2 != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/domain/filters/pods.go:57

What to do

  • Swallowed exception (caught, then discarded)
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

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.

Reference — by lens

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

LensScoreRatingImpact
Code Health50%Adequate — gated by D1, D2, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture81%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity92%ExemplarySolid.
Readiness74%Adequate — gated by P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security56%Adequate — gated by D28, D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling60%Adequate — gated by DM2, DM5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance95%ExemplaryStrongest area.
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 — 31 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 — 66 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.
  • 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 — the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence) 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 — ~88315 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.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; Go, Python not measured.
  • 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+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (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 — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .go, .py, .rb, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • 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.
  • 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
  • DM8 Value-object opportunities — not scored — the deterministic rule found 0 candidate clump(s); its rows are withheld until it has a measured precision of 95 % (a sample of fewer than 10 rows cannot show one)
  • 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — go (158,305 lines), c (1,987 lines), lua (15 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 0% of this repository's production lines — go (158,305 lines), c (1,987 lines), lua (15 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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.

Critical — 19 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · High secret · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: play.go ↔ types.go cmd/podman/kube/play.go:1 — `cmd/podman/kube/play.go` (context cmd) and `pkg/bindings/kube/types.go` (context pkg) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `342a2ebe` add --platform for kube play; `faf93bb0` feat(kube play): add --label flag to specify resource labels; `ff2eb1b0` The feature which allows multiple Pods creation — run `git show` on any of them.
Serious — 1802 finding(s)
D17 · Explicit Debt · TodoComment · ×191
  • TodoComment test/e2e/artifact_test.go:230 — // TODO: This can be removed once Artifact API supports streaming — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/generate_kube_test.go:545 — // TODO: v5.0 - change/remove test once we block --restart on container when it 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 test/e2e/logs_test.go:372 — // TODO: add 2-second wait loop to confirm cleanup — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/pod_create_test.go:1356 — // TODO: v5.0 change this so that the default value is Always — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/ps_test.go:555 — // TODO: This may be broken - the test was running without 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 test/e2e/run_device_test.go:62 — // TODO: Confirm absence of /dev/kmsg in container — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/run_device_test.go:69 — // TODO: Confirm write-permission failure — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/run_device_test.go:76 — // TODO: Confirm write-permission failure — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/stats_test.go:15 — // TODO: we need to check the output. Currently, we only check the exit codes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/e2e/system_reset_test.go:70 — // TODO: machine tests currently don't run outside of the machine test pkg — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/apiv2/python/rest_api/test_v2_0_0_container.py:273 — # TODO should handler be recursive when deleting images? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/apiv2/python/rest_api/test_v2_0_0_network.py:10 — # TODO Need to support Docker-py order of network/container creates — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/apiv2/python/rest_api/test_v2_0_0_network.py:51 — # TODO restore this to test, when joining multiple networks possible — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment test/apiv2/python/rest_api/test_v2_0_0_network.py:56 — # TODO Need to support network aliases — 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 pkg/util/utils_supported.go:5 — // TODO once rootless function is consolidated under libpod, we — 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 pkg/specgenutil/specgen.go:230 — // TODO: This should be moved into pkg/specgen/generate so we don't use the client's containers.conf — 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 pkg/specgenutil/specgen.go:340 — // TODO: This needs to move into pkg/specgen/generate so we aren't using containers.conf on the client. — 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 pkg/specgenutil/specgen.go:730 — // TODO convert to map? — 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 pkg/specgenutil/specgen.go:764 — // TODO selinux opts and label opts are the same thing — 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 pkg/specgenutil/specgen.go:838 — // TODO make sure these work in clone — 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 pkg/specgenutil/util.go:44 — // TODO: The SpecGen format should really handle ranges more sanely - we could — 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 pkg/specgenutil/volumes.go:52 — // TODO: handle options parsing/processing via containers/storage/pkg/mount — 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 pkg/specgenutil/volumes.go:55 — // TODO: The runtime config part of this needs to move into pkg/specgen/generate to avoid querying containers.conf on the client. — 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 pkg/specgenutil/volumes.go:198 — // TODO: Docker defaults to "volume" if no mount type is specified. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment pkg/specgenutil/volumes.go:648 — // TODO: add support for --volume-label — 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.
  • + 166 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×49
  • FunctionTooLong: common.DefineCreateFlags cmd/podman/common/create.go:33 — FunctionTooLong — DefineCreateFlags runs 779 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 679 over it, 7.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: specgenutil.FillOutSpecGen pkg/specgenutil/specgen.go:334 — FunctionTooLong — FillOutSpecGen runs 414 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 314 over it, 4.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: compat.createBuildOptions pkg/api/handlers/compat/images_build.go:407 — FunctionTooLong — createBuildOptions runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: common.buildFlagsWrapperToOptions cmd/podman/common/build.go:303 — FunctionTooLong — buildFlagsWrapperToOptions runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: kube.ToSpecGen pkg/specgen/generate/kube/kube.go:209 — FunctionTooLong — ToSpecGen runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: compat.cliOpts pkg/api/handlers/compat/containers_create.go:247 — FunctionTooLong — cliOpts runs 297 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: images.prepareParams REDACTED:135 — FunctionTooLong — prepareParams runs 281 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generate.createContainerOptions pkg/specgen/generate/container_create.go:389 — FunctionTooLong — createContainerOptions runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: quadlet.ConvertContainer pkg/systemd/quadlet/quadlet.go:605 — FunctionTooLong — ConvertContainer runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: filters.GenerateContainerFilterFuncs pkg/domain/filters/containers.go:51 — FunctionTooLong — GenerateContainerFilterFuncs runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generate.namespaceOptions pkg/specgen/generate/namespaces.go:124 — FunctionTooLong — namespaceOptions runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generate.MakeContainer pkg/specgen/generate/container_create.go:34 — FunctionTooLong — MakeContainer runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: libpod.makeRuntime libpod/runtime.go:330 — FunctionTooLong — makeRuntime runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: compat.PushImage pkg/api/handlers/compat/images_push.go:28 — FunctionTooLong — PushImage runs 179 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: libpod.ImagesPull pkg/api/handlers/libpod/images_pull.go:33 — FunctionTooLong — ImagesPull runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: libpod.ManifestModify pkg/api/handlers/libpod/manifests.go:494 — FunctionTooLong — ManifestModify runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: compat.LibpodToContainerJSON pkg/api/handlers/compat/containers.go:513 — FunctionTooLong — LibpodToContainerJSON runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generate.SpecGenToOCI pkg/specgen/generate/oci_linux.go:103 — FunctionTooLong — SpecGenToOCI runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: generate.ConfigToSpec pkg/specgen/generate/container.go:391 — FunctionTooLong — ConfigToSpec runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: util.processOptionsInternal pkg/util/mount_opts.go:36 — FunctionTooLong — processOptionsInternal runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: specgenutil.parseMountOptions pkg/specgenutil/volumes.go:317 — FunctionTooLong — parseMountOptions runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: utils.ExecuteTransfer pkg/domain/utils/scp.go:21 — FunctionTooLong — ExecuteTransfer runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: shim.startLocked pkg/machine/shim/host.go:558 — FunctionTooLong — startLocked runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: shim.Init pkg/machine/shim/host.go:72 — FunctionTooLong — Init runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: filters.GenerateExternalContainerFilterFuncs pkg/domain/filters/containers.go:367 — FunctionTooLong — GenerateExternalContainerFilterFuncs runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 24 more in this group — see findings.md.
D17 · Explicit Debt · FixmeComment · ×47
  • FixmeComment test/utils/matchers.go:142 — // FIXME - I see no situation in which we could ever want this? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/python/docker/compat/common.py:38 — # FIXME should DELETE /images accept the sha256: prefix? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/artifact_mount_test.go:54 — // FIXME: we need https://github.com/containers/container-selinux/pull/360 to fix the selinux access problem, until then disable it.
  • FixmeComment test/e2e/artifact_mount_test.go:154 — // FIXME: we need https://github.com/containers/container-selinux/pull/360 to fix the selinux access problem, until then disable it.
  • FixmeComment test/e2e/artifact_mount_test.go:179 — // FIXME: we need https://github.com/containers/container-selinux/pull/360 to fix the selinux access problem, until then disable it.
  • FixmeComment test/e2e/checkpoint_test.go:336 — // FIXME: criu emits an error message, but podman never sees it: — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/common_test.go:1279 — // FIXME: Remove this hack once composefs can be used with images — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/containers_conf_test.go:87 — // FIXME: Needs crun-1.8.2-2 to allow this with --cgroup-manager=cgroupfs, once this is available remove the skip 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 test/e2e/containers_conf_test.go:630 — // FIXME not sure why this is 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.
  • FixmeComment test/e2e/manifest_test.go:489 — // FIXME-someday: figure out why message differs in podman-remote — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/network_test.go:180 — // FIXME-someday: figure out why this part does not show up in remote — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/pod_rm_test.go:205 — // FIXME-someday: consolidate different error messages — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/push_test.go:363 — // FIXME 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 test/e2e/restart_test.go:248 — // FIXME - #20196: Cannot use ExitCleanly()
  • FixmeComment test/e2e/run_test.go:1959 — // FIXME - #20196: Cannot use ExitCleanly()
  • FixmeComment test/e2e/run_seccomp_test.go:49 — // FIXME: This test fails on arm64 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/run_test.go:464 — // FIXME: crun 1.24 fails with EACCES https://github.com/containers/crun/issues/1876
  • FixmeComment test/e2e/run_test.go:926 — // FIXME: drop "|51" once all the runtimes we test have the fix in place. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment test/e2e/run_test.go:937 — // FIXME: https://github.com/containers/podman/commit/9b9789c207d8b84ee37e9c37c613879369a8690c
  • FixmeComment test/e2e/run_test.go:947 — // FIXME: https://github.com/containers/podman/commit/9b9789c207d8b84ee37e9c37c613879369a8690c
  • FixmeComment test/e2e/run_test.go:957 — // FIXME: https://github.com/containers/podman/commit/9b9789c207d8b84ee37e9c37c613879369a8690c
  • FixmeComment test/e2e/run_test.go:967 — // FIXME: https://github.com/containers/podman/commit/9b9789c207d8b84ee37e9c37c613879369a8690c
  • FixmeComment test/e2e/tls_test.go:113 — // FIXME: this should contain many more tests to exercise libimage.Runtime.{SystemContext,imageContext,LibimageRuntime}. — 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.
  • + 22 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×40
  • Swallowed exception (caught, then discarded) pkg/systemd/quadlet/unitdirs.go:216 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/systemd/parser/unitfile.go:687 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/specgen/generate/container.go:633 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/specgen/generate/oci_linux.go:31 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/specgen/generate/pod_create.go:314 — `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:431 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/machine_windows.go:255 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/wsl/wutil/wutil.go:71 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/wsl/wutil/wutil.go:74 — `if err = cmd.Start(); 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:28 — `if nil != err` 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:32 — `if nil != err` 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:277 — `if fileErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.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) pkg/machine/shim/claim_darwin.go:31 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go:37 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go:42 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go:53 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/claim_darwin.go:58 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/shim/networking.go:271 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/qemu/machine.go:200 — `if err := qmpMonitor.Disconnect(); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/machine/ports/ports.go:113 — `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:39 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/lookup/lookup.go:114 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/lookup/lookup.go:147 — `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) pkg/k8s.io/apimachinery/pkg/api/resource/suffix.go:191 — `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.
  • + 15 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×36
  • Hotspot: REDACTED REDACTED:235 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 157 in Container.generateSpec at line 235. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 208 in specgenutil.FillOutSpecGen at line 334. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: cmd/podman/common/build.go cmd/podman/common/build.go:303 — cmd/podman/common/build.go changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in common.buildFlagsWrapperToOptions at line 303. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: libpod/container_internal.go libpod/container_internal.go:1750 — libpod/container_internal.go changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in Container.mountStorage at line 1750. 4 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/api/handlers/compat/containers_create.go pkg/api/handlers/compat/containers_create.go:247 — pkg/api/handlers/compat/containers_create.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in compat.cliOpts at line 247. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: pkg/domain/infra/abi/play.go pkg/domain/infra/abi/play.go:238 — pkg/domain/infra/abi/play.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in ContainerEngine.PlayKube at line 238. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/container.go pkg/specgen/generate/container.go:144 — pkg/specgen/generate/container.go changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in generate.CompleteSpec at line 144. 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/api/handlers/compat/images_build.go pkg/api/handlers/compat/images_build.go:407 — pkg/api/handlers/compat/images_build.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 88 in compat.createBuildOptions at line 407. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06:00' --full-history --no-merges -- pkg/api/handlers/compat/images_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: libpod/runtime.go libpod/runtime.go:330 — libpod/runtime.go changed 4 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/specgen/generate/container_create.go pkg/specgen/generate/container_create.go:34 — pkg/specgen/generate/container_create.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in generate.MakeContainer at line 34. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: pkg/specgen/generate/kube/kube.go pkg/specgen/generate/kube/kube.go:209 — pkg/specgen/generate/kube/kube.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in kube.ToSpecGen at line 209. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: cmd/podman/kube/play.go cmd/podman/kube/play.go:239 — cmd/podman/kube/play.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in kube.play at line 239. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/machine/shim/host.go pkg/machine/shim/host.go:558 — pkg/machine/shim/host.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in shim.startLocked at line 558. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: cmd/podman/root.go cmd/podman/root.go:270 — cmd/podman/root.go changed 3 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: libpod/container_inspect.go libpod/container_inspect.go:491 — libpod/container_inspect.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in Container.generateInspectContainerHostConfig at line 491. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06:00' --full-history --no-merges -- libpod/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.
  • Hotspot: pkg/api/handlers/compat/containers.go pkg/api/handlers/compat/containers.go:786 — pkg/api/handlers/compat/containers.go changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in compat.UpdateContainer at line 786. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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/common/create.go cmd/podman/common/create.go:33 — cmd/podman/common/create.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in common.DefineCreateFlags 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06:00' --full-history --no-merges -- cmd/podman/common/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_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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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.
  • Hotspot: cmd/quadlet/main.go cmd/quadlet/main.go:527 — cmd/quadlet/main.go changed 3 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-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: pkg/systemd/quadlet/quadlet.go pkg/systemd/quadlet/quadlet.go:1136 — pkg/systemd/quadlet/quadlet.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in quadlet.ConvertVolume at line 1136. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06: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: cmd/podman/containers/create.go cmd/podman/containers/create.go:120 — cmd/podman/containers/create.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in containers.create at line 120. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-14..2026-11-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-14 14:00:58 -06:00' --until='2026-11-12 14:00:58 -06:00' --full-history --no-merges -- cmd/podman/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.
  • + 11 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×32
  • 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:122 — pkg/api/handlers/libpod/artifacts.go:122-131 | pkg/api/handlers/libpod/artifacts.go:378-387 — both copies are in the same file, so extract the 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:449 — pkg/domain/infra/abi/play.go:449-458 | pkg/domain/infra/abi/play.go:464-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:449` 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:1144 — pkg/domain/infra/abi/play.go:1144-1153 | pkg/domain/infra/abi/play.go:1266-1275 — both copies are in the same file, so extract the 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:1277` calls `AddContainer` and `pkg/domain/infra/abi/play.go:1155` 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:1038-1047 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:411 — REDACTED:411-420 | REDACTED:862-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:411` 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.
  • + 7 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×31
  • FileTooLong: REDACTED REDACTED — FileTooLong — 1943 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: Container (51 blocks, 185-3389). The bar is 500 significant lines; this is 1443 over it, 3.89× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: quadlet/quadlet.go pkg/systemd/quadlet/quadlet.go — FileTooLong — 1667 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1167 over it, 3.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: libpod/container_internal.go libpod/container_internal.go — FileTooLong — 1621 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Container (74 blocks, 71-3080). The bar is 500 significant lines; this is 1121 over it, 3.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: libpod/sqlite_state.go libpod/sqlite_state.go — FileTooLong — 1342 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: SQLiteState (58 blocks, 27-2468). The bar is 500 significant lines; this is 842 over it, 2.68× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: abi/play.go pkg/domain/infra/abi/play.go — FileTooLong — 1325 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: ContainerEngine (15 blocks, 67-2094). The bar is 500 significant lines; this is 825 over it, 2.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: abi/containers.go pkg/domain/infra/abi/containers.go — FileTooLong — 1226 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: ContainerEngine (41 blocks, 164-1880). The bar is 500 significant lines; this is 726 over it, 2.45× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: common/completion.go cmd/podman/common/completion.go — FileTooLong — 1173 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 673 over it, 2.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: libpod/options.go libpod/options.go — FileTooLong — 1121 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 621 over it, 2.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 984 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: ConmonOCIRuntime (34 blocks, 54-1573). The bar is 500 significant lines; this is 484 over it, 1.97× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 904 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 404 over it, 1.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: compat/images_build.go pkg/api/handlers/compat/images_build.go — FileTooLong — 897 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 397 over it, 1.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: specgenutil/specgen.go pkg/specgenutil/specgen.go — FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 392 over it, 1.78× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: kube/kube.go pkg/specgen/generate/kube/kube.go — FileTooLong — 878 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 378 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: common/create.go cmd/podman/common/create.go — FileTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: DefineCreateFlags (33-1091). The bar is 500 significant lines; this is 324 over it, 1.65× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 809 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 309 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: libpod/runtime.go libpod/runtime.go — FileTooLong — 805 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 305 over it, 1.61× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: libpod/runtime_ctr.go libpod/runtime_ctr.go — FileTooLong — 795 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: Runtime (28 blocks, 48-1473). The bar is 500 significant lines; this is 295 over it, 1.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: tunnel/containers.go pkg/domain/infra/tunnel/containers.go — FileTooLong — 737 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: ContainerEngine (42 blocks, 30-1103). The bar is 500 significant lines; this is 237 over it, 1.47× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: libpod/container.go libpod/container.go — FileTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: Container (105 blocks, 96-1585). The bar is 500 significant lines; this is 219 over it, 1.44× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: abi/images.go pkg/domain/infra/abi/images.go — FileTooLong — 701 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: ImageEngine (21 blocks, 51-810). The bar is 500 significant lines; this is 201 over it, 1.40× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 666 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: Container (30 blocks, 162-1299). The bar is 500 significant lines; this is 166 over it, 1.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: compat/containers.go pkg/api/handlers/compat/containers.go — FileTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 139 over it, 1.28× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: libpod/container_api.go libpod/container_api.go — FileTooLong — 629 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: Container (34 blocks, 32-1281). The bar is 500 significant lines; this is 129 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: libpod/images.go pkg/api/handlers/libpod/images.go — FileTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 104 over it, 1.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×28
  • Duplicated block (8 lines × 2) libpod/container_internal.go:1113 — libpod/container_internal.go:1113-1120 | libpod/container_internal.go:1655-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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_internal.go:1113` 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: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:1570 — REDACTED:1570-1577 | REDACTED:2038-2045 — both copies are in the same file, so extract the 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:215 — REDACTED:215-222 | REDACTED:234-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • 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:581-588 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:438-445 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:787 — pkg/api/handlers/libpod/images.go:787-794 | pkg/api/handlers/REDACTED:240-247 — 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:787` 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:304-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/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) libpod/container_internal_linux.go:500 — libpod/container_internal_linux.go:500-507 | libpod/options.go:867-874 — 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) 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:863 — libpod/sqlite_state.go:863-870 | libpod/sqlite_state.go:1244-1251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:863` 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:872` calls `Commit`, `Errorf`, `ID` and `libpod/sqlite_state.go:1253` 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:1389 — libpod/sqlite_state.go:1389-1396 | libpod/sqlite_state.go:1462-1469 — both copies are in the same file, so extract the 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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×27
  • 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:622 — libpod/container_api.go:622-632 | libpod/container_api.go:669-679 — both copies are in the same file, so extract the 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:1019 — pkg/api/handlers/compat/images_build.go:1019-1029 | pkg/api/handlers/compat/images_build.go:1198-1208 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images_build.go:1019` 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:1144-1154 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:1497 — libpod/sqlite_state.go:1497-1507 | libpod/sqlite_state.go:2300-2312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1497` it does not close everything it opens, so those exact lines 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) 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) 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/container_api.go:472 — libpod/container_api.go:472-482 | libpod/container_api.go:1038-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:472` 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.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×23
  • 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:901 — libpod/container_internal.go:901-909 | 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:901` it does not close everything it opens, so those exact lines 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:764 — pkg/api/handlers/compat/containers.go:764-772 | 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:764` 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:152 — REDACTED:152-160 | REDACTED:180-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 `REDACTED:152` it does not close everything it opens, so those exact lines 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:1111 — pkg/specgenutil/specgen.go:1111-1119 | pkg/specgenutil/specgen.go:1159-1167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgenutil/specgen.go:1111` it does not close everything it opens, so those exact lines 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:382 — REDACTED:382-390 | REDACTED:835-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:382` it does not close everything it opens, so those exact lines 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:41 — REDACTED:41-49 | REDACTED:103-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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:1236 — libpod/sqlite_state.go:1236-1244 | libpod/sqlite_state.go:1625-1633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1236` it does not close everything it opens, so those exact 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) pkg/bindings/images/images.go:352 — pkg/bindings/images/images.go:352-360 | pkg/bindings/volumes/volumes.go:141-149 — `pkg/bindings/images/images.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 6 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/images/images.go:352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) libpod/sqlite_state.go:1369 — libpod/sqlite_state.go:1369-1377 | libpod/sqlite_state.go:1425-1433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1369` it does not close everything it opens, so those exact 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.
D3 · God Classes · MethodTooLong · ×20
  • MethodTooLong: Container.generateSpec REDACTED:235 — MethodTooLong — generateSpec runs 403 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContainerEngine.playKubePod pkg/domain/infra/abi/play.go:737 — MethodTooLong — playKubePod runs 390 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 290 over it, 3.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.restore REDACTED:1696 — MethodTooLong — restore runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContainerEngine.PlayKube pkg/domain/infra/abi/play.go:238 — MethodTooLong — PlayKube runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Runtime.setupContainer libpod/runtime_ctr.go:245 — MethodTooLong — setupContainer runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Runtime.removeContainer libpod/runtime_ctr.go:704 — MethodTooLong — removeContainer runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.platformInspectContainerHostConfig libpod/container_inspect_linux.go:21 — MethodTooLong — platformInspectContainerHostConfig runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConmonOCIRuntime.createOCIContainer REDACTED:1027 — MethodTooLong — createOCIContainer runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.getContainerInspectData libpod/container_inspect.go:65 — MethodTooLong — getContainerInspectData runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConmonOCIRuntime.HTTPAttach REDACTED:478 — MethodTooLong — HTTPAttach runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pod.Inspect libpod/pod_api.go:595 — MethodTooLong — Inspect runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Runtime.newVolume libpod/runtime_volume_common.go:48 — MethodTooLong — newVolume runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.copyFromArchive libpod/container_copy_common.go:27 — MethodTooLong — copyFromArchive runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.mountStorage libpod/container_internal.go:1750 — MethodTooLong — mountStorage runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.makeBindMounts REDACTED:2154 — MethodTooLong — makeBindMounts runs 115 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Farm.Build pkg/farm/farm.go:224 — MethodTooLong — Build runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContainerEngine.GenerateKube pkg/domain/infra/abi/generate.go:113 — MethodTooLong — GenerateKube runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContainerEngine.PlayKubeDown pkg/domain/infra/abi/play.go:1867 — MethodTooLong — PlayKubeDown runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Container.WaitForConditionWithInterval libpod/container_api.go:737 — MethodTooLong — WaitForConditionWithInterval runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Runtime.Reset libpod/reset.go:95 — MethodTooLong — Reset runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D29 · Static Analysis (SAST) · REDACTED · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyFields · ×15
  • TooManyFields: ContainerCreateOptions pkg/domain/entities/pods.go:139 — TooManyFields — 138 stored fields. The bar is 30 stored fields; this is 108 over it, 4.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: BuildQuery pkg/api/handlers/compat/images_build.go:49 — TooManyFields — 98 stored fields. The bar is 30 stored fields; this is 68 over it, 3.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: InspectContainerHostConfig libpod/define/container_inspect.go:372 — TooManyFields — 73 stored fields. The bar is 30 stored fields; this is 43 over it, 2.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ContainerMiscConfig libpod/container_config.go:345 — TooManyFields — 49 stored fields. The bar is 30 stored fields; this is 19 over it, 1.63× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: InspectContainerData libpod/define/container_inspect.go:775 — TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ContainerBasicConfig pkg/specgen/specgen.go:39 — TooManyFields — 43 stored fields. The bar is 30 stored fields; this is 13 over it, 1.43× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: InspectContainerConfig libpod/define/container_inspect.go:21 — TooManyFields — 38 stored fields beside 2 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: HostInfo libpod/define/info.go:30 — TooManyFields — 38 stored fields. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PodmanConfig pkg/domain/entities/engine.go:26 — TooManyFields — 38 stored fields. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PlayKubeOptions pkg/domain/entities/play.go:46 — TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: InspectPodData libpod/define/pod_inspect.go:10 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: containerInfo pkg/systemd/generate/containers.go:26 — TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ContainerState libpod/container.go:140 — TooManyFields — 34 stored fields. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: ContainerStorageConfig pkg/specgen/specgen.go:239 — TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
  • TooManyFields: PlayOptions pkg/bindings/kube/types.go:10 — TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×15
  • 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:126 — pkg/api/handlers/libpod/artifacts.go:126-138 | 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:204 — pkg/api/handlers/libpod/images.go:204-216 | pkg/api/handlers/libpod/images.go:361-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:204` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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:1273 — REDACTED:1273-1285 | REDACTED:1291-1303 — both copies are in the same file, so extract the 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:1086 — pkg/domain/infra/abi/play.go:1086-1098 | pkg/domain/infra/abi/play.go:1176-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1086` it does not close everything it opens, so those exact lines 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:1123 — pkg/domain/infra/abi/play.go:1123-1135 | pkg/domain/infra/abi/play.go:1220-1232 — both copies are in the same file, so extract the block into 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:130 — REDACTED:130-142 | REDACTED:297-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (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:661 — libpod/sqlite_state.go:661-673 | libpod/sqlite_state.go:1535-1547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:661` 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:1774 — libpod/sqlite_state.go:1774-1786 | libpod/sqlite_state.go:1849-1861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:1774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×14
  • 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:1607 — libpod/sqlite_state.go:1607-1622 | libpod/sqlite_state.go:1648-1663 — both copies are in the same file, so extract the 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:270 — pkg/domain/infra/abi/play.go:270-285 | pkg/domain/infra/abi/play.go:1876-1891 — both copies are in the same file, so extract the 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×14
  • 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:314-325 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) 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:526 — libpod/sqlite_state.go:526-537 | libpod/sqlite_state.go:551-562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:526` it does not close everything it opens, so those exact lines 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) libpod/container.go:886 — libpod/container.go:886-892 | libpod/container.go:898-904 — both copies are in the same file, so extract the 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:3072 — REDACTED:3072-3078 | REDACTED:3118-3124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:3072` it does not close everything it opens, so those exact 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:425 — REDACTED:425-431 | REDACTED:876-882 — both copies are in the same file, so extract the block into 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:37 — REDACTED:37-43 | pkg/domain/infra/tunnel/manifest.go:28-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) pkg/api/handlers/compat/images.go:56 — pkg/api/handlers/compat/images.go:56-62 | pkg/api/handlers/libpod/images.go:424-430 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:552 — pkg/machine/wsl/machine.go:552-558 | pkg/machine/wsl/machine.go:561-567 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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:3050 — REDACTED:3050-3056 | REDACTED:3096-3102 — both copies are in the same file, so extract the 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:65-71 — 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:638 — libpod/sqlite_state_internal.go:638-644 | libpod/sqlite_state_internal.go:657-663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:638` it does not close everything it opens, so those exact 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.
D3 · God Classes · TooManyMethods · ×13
  • TooManyMethods: Container libpod/container.go:96 — TooManyMethods — 405 methods, declared across 35 files: libpod/container.go (104), libpod/container_internal.go (74), REDACTED (51), libpod/container_api.go (34), +31 more file(s). The bar is 30 methods; this is 375 over it, 13.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Runtime libpod/runtime.go:67 — TooManyMethods — 145 methods, declared across 27 files: libpod/runtime.go (36), libpod/runtime_ctr.go (28), libpod/runtime_pod.go (9), libpod/runtime_volume.go (8), +23 more file(s). The bar is 30 methods; this is 115 over it, 4.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContainerEngine pkg/domain/infra/abi/runtime.go:18 — TooManyMethods — 134 methods, declared across 18 files: abi/containers.go (41), abi/pods.go (17), abi/play.go (15), abi/volumes.go (14), +14 more file(s). The bar is 30 methods; this is 104 over it, 4.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement entities.ContainerEngine (111 of 134 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ContainerEngine pkg/domain/infra/tunnel/runtime.go:21 — TooManyMethods — 111 methods, declared across 11 files: tunnel/containers.go (42), tunnel/pods.go (16), tunnel/volumes.go (13), tunnel/system.go (11), +7 more file(s). The bar is 30 methods; this is 81 over it, 3.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement entities.ContainerEngine (111 of 111 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: Pod libpod/pod.go:30 — TooManyMethods — 75 methods, declared across 10 files: libpod/pod.go (45), libpod/pod_api.go (13), libpod/service.go (6), REDACTED (3), +6 more file(s). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SQLiteState libpod/sqlite_state.go:27 — TooManyMethods — 64 methods, declared across 2 files: libpod/sqlite_state.go (57), libpod/sqlite_state_internal.go (7). The bar is 30 methods; this is 34 over it, 2.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement libpod.State (56 of 64 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ImageEngine pkg/domain/infra/abi/runtime.go:12 — TooManyMethods — 49 methods, declared across 6 files: abi/images.go (21), abi/manifest.go (12), abi/artifact.go (9), abi/farm.go (4), +2 more file(s). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement entities.ImageEngine (46 of 49 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ImageEngine pkg/domain/infra/tunnel/runtime.go:15 — TooManyMethods — 48 methods, declared across 5 files: REDACTED (23), tunnel/manifest.go (10), REDACTED (9), tunnel/farm.go (4), +1 more file(s). The bar is 30 methods; this is 18 over it, 1.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement entities.ImageEngine (46 of 48 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: ConmonOCIRuntime REDACTED:54 — TooManyMethods — 45 methods, declared across 4 files: REDACTED (33), libpod/oci_conmon_exec_common.go (8), libpod/oci_conmon_linux.go (3), REDACTED (1). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. Most of these members implement libpod.OCIRuntime (33 of 45 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: UnitFile pkg/systemd/parser/unitfile.go:40 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MissingRuntime libpod/oci_missing.go:27 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. Most of these members implement libpod.OCIRuntime (33 of 34 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: Volume libpod/volume.go:25 — TooManyMethods — 34 methods, declared across 6 files: libpod/volume.go (24), libpod/volume_internal.go (5), libpod/volume_internal_common.go (2), libpod/events.go (1), +2 more file(s). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: APIServer REDACTED:38 — TooManyMethods — 33 methods, declared across 28 files: REDACTED (4), server/handler_api.go (3), server/register_archive.go (1), server/register_artifacts.go (1), +24 more file(s). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X2 · Cancellation propagation · Function without context.Context · ×13
  • 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: 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, …)`.
  • 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: 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: 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: 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: 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: 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: 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: readerFromArg cmd/podman/kube/play.go:448 — `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, …)`.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×10
  • 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) 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:764 — pkg/api/handlers/libpod/images.go:764-769 | 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:764` 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) pkg/domain/infra/abi/containers.go:255 — pkg/domain/infra/abi/containers.go:255-260 | pkg/domain/infra/abi/containers.go:276-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:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) REDACTED:862 — REDACTED:862-867 | 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:1169-1175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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) REDACTED:211 — REDACTED:211-216 | 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: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 (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.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×9
  • Edited copy of a member (12 corresponding lines) cmd/podman/common/format.go:10 — cmd/podman/common/format.go:10-21 | libpod/sqlite_state_internal.go:670-684 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) cmd/podman/containers/diff.go:30 — cmd/podman/containers/diff.go:30-44 | cmd/podman/diff.go:33-44 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/machine/env/dir.go:16 — pkg/machine/env/dir.go:16-27 | pkg/machine/env/dir.go:110-121 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/domain/filters/containers.go:353 — pkg/domain/filters/containers.go:353-364 | pkg/domain/filters/volumes.go:135-146 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) cmd/podman/common/completion.go:765 — cmd/podman/common/completion.go:765-776 | cmd/podman/common/completion.go:862-874 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pkg/machine/lock/lock.go:25 — pkg/machine/lock/lock.go:25-36 | pkg/machine/ports/ports.go:138-151 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) libpod/stats_freebsd.go:117 — libpod/stats_freebsd.go:117-128 | libpod/stats_linux.go:100-111 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) libpod/runtime_ctr.go:1247 — libpod/runtime_ctr.go:1247-1260 | libpod/runtime_volume.go:37-48 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) libpod/runtime_ctr.go:1334 — libpod/runtime_ctr.go:1334-1345 | libpod/runtime_volume.go:51-62 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×9
  • Duplicated block (15 lines × 2) libpod/container_api.go:194 — libpod/container_api.go:194-208 | libpod/container_internal.go:1254-1268 — 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:194` it does not close everything it opens, so those exact 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:53-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, 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, `libpod/networking_linux.go:50` calls `IsPasta`, `setupPasta` and `libpod/networking_freebsd.go:68` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (15 lines × 2) 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:2319 — libpod/sqlite_state.go:2319-2333 | libpod/sqlite_state.go:2372-2386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:2319` 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:804 — pkg/api/handlers/libpod/images.go:804-818 | 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:804` 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:982-996 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×9
  • 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:1110 — pkg/specgenutil/specgen.go:1110-1117 | pkg/specgenutil/specgen.go:1136-1143 | pkg/specgenutil/specgen.go:1158-1165 — all 3 copies are in the same file, so extract the block into one function there and call 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:1110` it does not close everything it opens, so those exact 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) REDACTED:294 — REDACTED:294-301 | REDACTED:348-355 | REDACTED:505-512 — all 3 copies are in the same file, so extract the block into one function there and call 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:294` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) 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:507-514 — 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 · Edited copy of a member (17 corresponding lines) · ×8
  • Edited copy of a member (17 corresponding lines) REDACTED:40 — REDACTED:40-65 | REDACTED:102-118 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) cmd/podman/containers/pause.go:55 — cmd/podman/containers/pause.go:55-71 | cmd/podman/containers/unpause.go:53-69 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/bindings/images/images.go:349 — pkg/bindings/images/images.go:349-365 | pkg/bindings/volumes/volumes.go:138-155 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) libpod/events.go:99 — libpod/events.go:99-118 | libpod/events.go:121-137 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/api/handlers/libpod/volumes.go:232 — pkg/api/handlers/libpod/volumes.go:232-248 | pkg/api/handlers/libpod/volumes.go:251-273 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) libpod/container.go:968 — libpod/container.go:968-984 | libpod/container.go:1446-1468 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) libpod/options.go:1393 — libpod/options.go:1393-1409 | libpod/options.go:1412-1429 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pkg/autoupdate/autoupdate.go:81 — pkg/autoupdate/autoupdate.go:81-97 | pkg/seccomp/seccomp.go:37-53 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) cmd/podman/images/unmount.go:51 — cmd/podman/images/unmount.go:51-71 | cmd/podman/secrets/rm.go:34-51 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/api/handlers/libpod/artifacts.go:27 — pkg/api/handlers/libpod/artifacts.go:27-46 | pkg/api/handlers/libpod/artifacts.go:166-183 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) cmd/podman/containers/cleanup.go:17 — cmd/podman/containers/cleanup.go:17-38 | cmd/podman/networks/reload.go:15-32 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) libpod/container_path_resolution.go:207 — libpod/container_path_resolution.go:207-224 | libpod/container_path_resolution.go:244-261 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) pkg/domain/infra/abi/artifact.go:267 — pkg/domain/infra/abi/artifact.go:267-284 | pkg/domain/infra/abi/artifact.go:286-304 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) REDACTED:2506 — REDACTED:2506-2523 | REDACTED:2527-2544 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) libpod/runtime.go:1211 — libpod/runtime.go:1211-1229 | pkg/specgen/generate/oci_linux.go:29-46 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (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:262-286 | 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.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×6
  • Edited copy of a member (13 corresponding lines) REDACTED:718 — REDACTED:718-731 | libpod/oci_conmon_exec_common.go:195-207 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/systemd/parser/unitfile.go:911 — pkg/systemd/parser/unitfile.go:911-923 | pkg/systemd/parser/unitfile.go:925-937 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/machine/wsl/usermodenet.go:247 — pkg/machine/wsl/usermodenet.go:247-259 | pkg/machine/wsl/usermodenet.go:261-273 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) libpod/container.go:1019 — libpod/container.go:1019-1031 | libpod/runtime.go:730-744 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) libpod/container_internal_linux.go:744 — libpod/container_internal_linux.go:744-756 | libpod/container_internal_freebsd.go:417-431 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pkg/domain/entities/reports/prune.go:32 — pkg/domain/entities/reports/prune.go:32-46 | pkg/domain/entities/types/secrets.go:57-69 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×6
  • 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:998-1015 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (18 lines × 2) REDACTED:279 — REDACTED:279-296 | REDACTED:333-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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 (18 lines × 2) pkg/specgen/generate/storage.go:71 — pkg/specgen/generate/storage.go:71-88 | pkg/specgen/generate/storage.go:113-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: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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×6
  • 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:49 — libpod/container_api.go:49-65 | libpod/container_internal.go:816-832 — 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) pkg/domain/infra/abi/play.go:370 — pkg/domain/infra/abi/play.go:370-386 | pkg/domain/infra/abi/play.go:498-514 — both copies are in the same file, so extract the 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.
  • Duplicated block (17 lines × 2) pkg/domain/infra/abi/play.go:666 — pkg/domain/infra/abi/play.go:666-682 | pkg/domain/infra/abi/play.go:714-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, 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 · Edited copy of a member (39 corresponding lines) · ×5
  • Edited copy of a member (39 corresponding lines) pkg/api/handlers/libpod/images.go:780 — pkg/api/handlers/libpod/images.go:780-818 | pkg/api/handlers/libpod/manifests.go:751-791 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) cmd/podman/containers/mount.go:82 — cmd/podman/containers/mount.go:82-127 | cmd/podman/images/mount.go:61-99 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) libpod/sqlite_state.go:602 — libpod/sqlite_state.go:602-640 | libpod/sqlite_state.go:1518-1560 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) REDACTED:85 — REDACTED:85-127 | REDACTED:130-168 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) pkg/systemd/generate/containers.go:26 — pkg/systemd/generate/containers.go:26-120 | pkg/systemd/generate/pods.go:25-129 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×5
  • Edited copy of a member (31 corresponding lines) cmd/podman/networks/rm.go:52 — cmd/podman/networks/rm.go:52-82 | cmd/podman/volumes/rm.go:52-84 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/api/handlers/compat/containers.go:208 — pkg/api/handlers/compat/containers.go:208-240 | pkg/api/handlers/libpod/containers.go:127-157 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) libpod/sqlite_state.go:1130 — libpod/sqlite_state.go:1130-1160 | libpod/sqlite_state.go:1258-1288 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/domain/infra/abi/terminal/sigproxy_commn.go:19 — pkg/domain/infra/abi/terminal/sigproxy_commn.go:19-49 | pkg/domain/infra/abi/terminal/sigproxy_commn.go:52-86 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (31 corresponding lines) pkg/systemd/parser/unitfile.go:704 — pkg/systemd/parser/unitfile.go:704-734 | pkg/systemd/parser/unitfile.go:737-767 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×5
  • Edited copy of a member (23 corresponding lines) REDACTED:150 — REDACTED:150-172 | REDACTED:174-203 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) pkg/domain/infra/abi/play.go:665 — pkg/domain/infra/abi/play.go:665-687 | pkg/domain/infra/abi/play.go:713-735 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) REDACTED:42 — REDACTED:42-66 | REDACTED:71-93 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) libpod/container_inspect.go:652 — libpod/container_inspect.go:652-676 | libpod/container_inspect.go:678-700 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (23 corresponding lines) cmd/podman/containers/mount.go:129 — cmd/podman/containers/mount.go:129-151 | cmd/podman/images/mount.go:101-124 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×5
  • Edited copy of a member (11 corresponding lines) pkg/domain/infra/abi/farm.go:47 — pkg/domain/infra/abi/farm.go:47-58 | pkg/domain/infra/tunnel/farm.go:38-48 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) libpod/healthcheck.go:448 — libpod/healthcheck.go:448-463 | REDACTED:127-137 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) libpod/pod.go:217 — libpod/pod.go:217-227 | libpod/pod.go:230-240 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) libpod/options.go:1244 — libpod/options.go:1244-1254 | libpod/options.go:1261-1271 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pkg/domain/infra/abi/generate.go:368 — pkg/domain/infra/abi/generate.go:368-380 | pkg/specgenutil/util.go:30-40 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×5
  • Duplicated block (10 lines × 4) libpod/container_api.go:59 — libpod/container_api.go:59-69 | libpod/container_internal.go:826-836 | libpod/container_internal.go:1209-1219 | libpod/container_internal.go:1716-1725 — 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:1224` calls `Debugf`, `ID` and `libpod/container_internal.go:840` 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×5
  • Duplicated block (5 lines × 2) libpod/runtime_ctr.go:1036 — libpod/runtime_ctr.go:1036-1040 | libpod/runtime_ctr.go:1192-1196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1036` it does not close everything it opens, so those exact 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:245 — pkg/api/handlers/REDACTED:245-249 | 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:245` 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) libpod/runtime_ctr.go:844 — libpod/runtime_ctr.go:844-848 | libpod/runtime_ctr.go:864-868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/runtime_ctr.go:844` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • 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.
D3 · God Classes · ClassTooLong · ×4
  • ClassTooLong: SQLiteState libpod/sqlite_state.go:27 — ClassTooLong — 1283 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods, 58 blocks, lines 27-2468. The bar is 400 significant lines; this is 883 over it, 3.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ConmonOCIRuntime REDACTED:54 — ClassTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods, 34 blocks, lines 54-1573. The bar is 400 significant lines; this is 268 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Container libpod/container.go:96 — ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 405 methods, 105 blocks, lines 96-1585. The bar is 400 significant lines; this is 182 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Runtime libpod/runtime.go:67 — ClassTooLong — 424 significant lines (blank, comment-only and punctuation-only lines excluded), 145 methods, 37 blocks, lines 67-1533. The bar is 400 significant lines; this is 24 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • 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:44 — libpod/container_api.go:44-78 | libpod/container_internal.go:805-850 | libpod/container_internal.go:1191-1240 | libpod/container_internal.go:1682-1743 — 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/libpod/artifacts.go:79 — pkg/api/handlers/libpod/artifacts.go:79-164 | pkg/api/handlers/libpod/artifacts.go:246-267 | pkg/api/handlers/libpod/artifacts.go:269-307 | pkg/api/handlers/libpod/images.go:452-494 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×4
  • Edited copy of a member (19 corresponding lines) pkg/machine/ports/ports_unix.go:10 — pkg/machine/ports/ports_unix.go:10-28 | pkg/machine/ports/ports_windows.go:10-28 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) libpod/runtime_ctr.go:1312 — libpod/runtime_ctr.go:1312-1330 | libpod/runtime_pod.go:113-131 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pkg/machine/provider/platform.go:10 — pkg/machine/provider/platform.go:10-29 | pkg/machine/shim/host.go:398-416 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) libpod/util_linux.go:58 — libpod/util_linux.go:58-76 | libpod/util_linux.go:79-98 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×4
  • Edited copy of a member (14 corresponding lines) pkg/domain/infra/tunnel/containers.go:348 — pkg/domain/infra/tunnel/containers.go:348-361 | pkg/domain/infra/tunnel/pods.go:210-223 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) libpod/runtime_ctr.go:1396 — libpod/runtime_ctr.go:1396-1409 | libpod/runtime_ctr.go:1425-1443 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/api/handlers/libpod/pods.go:319 — pkg/api/handlers/libpod/pods.go:319-333 | pkg/domain/infra/abi/pods.go:299-312 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pkg/auth/auth.go:307 — pkg/auth/auth.go:307-320 | pkg/copy/fileinfo.go:41-54 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) libpod/container_internal_freebsd.go:304 — libpod/container_internal_freebsd.go:304-311 | libpod/container_internal_linux.go:589-596 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pkg/machine/wsl/machine.go:551 — pkg/machine/wsl/machine.go:551-558 | pkg/machine/wsl/machine.go:560-567 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) libpod/events.go:177 — libpod/events.go:177-184 | libpod/runtime_img.go:107-114 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) libpod/pod.go:359 — libpod/pod.go:359-366 | libpod/service.go:41-48 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×4
  • Edited copy of a member (7 corresponding lines) pkg/domain/infra/abi/pods.go:53 — pkg/domain/infra/abi/pods.go:53-59 | pkg/domain/infra/abi/quadlet.go:532-538 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/api/server/handler_api.go:79 — pkg/api/server/handler_api.go:79-86 | pkg/api/server/handler_logging.go:41-47 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/domain/entities/reports/prune.go:21 — pkg/domain/entities/reports/prune.go:21-30 | pkg/domain/entities/types/secrets.go:49-55 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pkg/domain/infra/abi/images.go:51 — pkg/domain/infra/abi/images.go:51-57 | pkg/domain/infra/abi/volumes.go:196-202 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • 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:162 — libpod/sqlite_state.go:162-171 | libpod/sqlite_state.go:194-203 | libpod/sqlite_state.go:227-236 — all 3 copies are in the same file, so extract the block into one function there and call 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:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) pkg/api/handlers/compat/containers_pause.go:14 — pkg/api/handlers/compat/containers_pause.go:14-22 | 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 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (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:1373 — libpod/sqlite_state.go:1373-1379 | libpod/sqlite_state.go:1429-1435 | libpod/sqlite_state.go:2225-2231 — all 3 copies are in the same file, so extract the block into one function there and call 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:1373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) REDACTED:432 — REDACTED:432-436 | REDACTED:442-446 | REDACTED:452-456 — all 3 copies are in the same file, so extract the block into one function there and call it from 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:762 — pkg/api/handlers/compat/containers.go:762-766 | 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:762` 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:1746 — libpod/sqlite_state.go:1746-1750 | libpod/sqlite_state.go:2092-2096 | 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:1746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience cmd/podman/kube/play.go:451 — `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.
D17 · Explicit Debt · XxxComment · ×3
  • XxxComment pkg/systemd/quadlet/quadlet.go:1015 — // 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:2283 — // 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:1896 — // 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×3
  • 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: container_config.go ↔ options.go libpod/container_config.go:1 — `libpod/container_config.go` and `libpod/options.go` change together 53% of the time (10 of the 19 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 10 shared commits counted here, the most recent 3 are `385f0905` log: expose conmon log rotation options through REST API and CLI; `636eb1a4` libpod: Implement --log-opt label=LABEL=Value; `d7a80dda` Discover vendor from cdi spec before injecting CDI device for --gpu o… — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×3
  • Edited copy of a member (46 corresponding lines) pkg/specgenutil/volumes.go:671 — pkg/specgenutil/volumes.go:671-721 | pkg/specgenutil/volumes.go:725-770 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) pkg/domain/infra/abi/containers.go:563 — pkg/domain/infra/abi/containers.go:563-614 | pkg/domain/infra/abi/pods.go:525-570 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (46 corresponding lines) libpod/boltdb_state_internal.go:192 — libpod/boltdb_state_internal.go:192-248 | libpod/sqlite_state_internal.go:278-323 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×3
  • Edited copy of a member (22 corresponding lines) pkg/api/handlers/libpod/images.go:78 — pkg/api/handlers/libpod/images.go:78-103 | pkg/api/handlers/REDACTED:235-256 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) libpod/runtime.go:763 — libpod/runtime.go:763-784 | libpod/runtime.go:797-818 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) REDACTED:279 — REDACTED:279-300 | pkg/bindings/kube/kube.go:146-168 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×3
  • Edited copy of a member (25 corresponding lines) pkg/api/handlers/compat/networks.go:530 — pkg/api/handlers/compat/networks.go:530-554 | pkg/api/handlers/libpod/networks.go:174-202 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) cmd/podman/containers/prune.go:48 — cmd/podman/containers/prune.go:48-75 | cmd/podman/networks/prune.go:54-78 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) libpod/boltdb_state.go:107 — libpod/boltdb_state.go:107-131 | libpod/boltdb_state.go:351-381 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×3
  • Edited copy of a member (16 corresponding lines) pkg/machine/ports/ports.go:120 — pkg/machine/ports/ports.go:120-136 | REDACTED:10-25 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) pkg/machine/provider/platform_unix.go:18 — pkg/machine/provider/platform_unix.go:18-34 | pkg/machine/provider/platform_windows.go:17-32 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) libpod/container_api.go:470 — libpod/container_api.go:470-487 | libpod/container_api.go:1036-1051 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×3
  • Edited copy of a member (10 corresponding lines) pkg/api/handlers/libpod/info.go:14 — pkg/api/handlers/libpod/info.go:14-23 | pkg/api/handlers/libpod/system.go:61-72 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pkg/domain/infra/runtime_abi.go:14 — pkg/domain/infra/runtime_abi.go:14-24 | pkg/domain/infra/runtime_tunnel.go:36-45 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) libpod/info.go:199 — libpod/info.go:199-208 | pkg/api/handlers/compat/info.go:149-158 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×3
  • Edited copy of a member (9 corresponding lines) pkg/env/env_windows.go:5 — pkg/env/env_windows.go:5-25 | pkg/env/env_unix.go:7-15 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) cmd/podman/system/connection.go:11 — cmd/podman/system/connection.go:11-19 | cmd/podman/system/context.go:11-20 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) cmd/podman/images/exists.go:9 — cmd/podman/images/exists.go:9-18 | cmd/podman/manifest/exists.go:9-17 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) libpod/sqlite_state.go:898 — libpod/sqlite_state.go:898-908 | libpod/sqlite_state.go:928-938 | libpod/sqlite_state.go:1675-1685 — all 3 copies are in the same file, so extract the block into one function there and call 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:898` 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:909` calls `Unmarshal`, `Errorf`, `ID` and `libpod/sqlite_state.go:940` 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) pkg/domain/infra/abi/play.go:396 — pkg/domain/infra/abi/play.go:396-404 | pkg/domain/infra/abi/play.go:415-423 | pkg/domain/infra/abi/play.go:485-493 — all 3 copies are in the same file, so extract the block into one function there and call it from 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:679 — pkg/domain/infra/abi/play.go:679-687 | pkg/domain/infra/abi/play.go:703-711 | pkg/domain/infra/abi/play.go:727-735 — all 3 copies are in the same file, so extract the block into one function there and call 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:679` 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:678` calls `Sprintf` and `pkg/domain/infra/abi/play.go:701` 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.
D17 · Explicit Debt · HackComment · ×2
  • HackComment REDACTED:644 — // 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 libpod/oci_conmon_exec_common.go:627 — // 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (29 corresponding lines) · ×2
  • Edited copy of a member (29 corresponding lines) libpod/sqlite_state.go:881 — libpod/sqlite_state.go:881-954 | libpod/sqlite_state.go:1647-1700 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (29 corresponding lines) cmd/podman/parse/net.go:102 — cmd/podman/parse/net.go:102-134 | pkg/env/env.go:91-119 — 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 (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.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) libpod/sqlite_state.go:644 — libpod/sqlite_state.go:644-699 | libpod/sqlite_state.go:2336-2386 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (51 corresponding lines) libpod/boltdb_state.go:384 — libpod/boltdb_state.go:384-434 | libpod/boltdb_state.go:492-542 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 33+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 33+ corresponding lines) pkg/bindings/auto-update/auto-update.go:16 — pkg/bindings/auto-update/auto-update.go:16-54 | pkg/bindings/manifests/manifests.go:80-112 | pkg/bindings/manifests/manifests.go:117-149 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 33+ corresponding lines) pkg/bindings/artifacts/pull.go:13 — pkg/bindings/artifacts/pull.go:13-52 | pkg/bindings/artifacts/push.go:13-45 | pkg/bindings/images/images.go:288-325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 29+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 29+ corresponding lines) libpod/sqlite_state.go:1226 — libpod/sqlite_state.go:1226-1254 | libpod/sqlite_state.go:1606-1644 | libpod/sqlite_state.go:2418-2446 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 29+ corresponding lines) libpod/sqlite_state.go:742 — libpod/sqlite_state.go:742-770 | libpod/sqlite_state.go:1935-1963 | libpod/sqlite_state.go:2180-2208 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/domain/infra/abi/containers.go:254 — pkg/domain/infra/abi/containers.go:254-273 | pkg/domain/infra/abi/containers.go:275-294 | pkg/domain/infra/abi/containers.go:409-433 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 20+ corresponding lines) pkg/bindings/containers/containers.go:389 — pkg/bindings/containers/containers.go:389-411 | pkg/bindings/containers/containers.go:415-436 | pkg/bindings/containers/containers.go:441-460 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/specgenutil/specgen.go:1108 — pkg/specgenutil/specgen.go:1108-1132 | pkg/specgenutil/specgen.go:1134-1154 | pkg/specgenutil/specgen.go:1156-1173 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 18+ corresponding lines) pkg/bindings/containers/containers.go:79 — pkg/bindings/containers/containers.go:79-99 | pkg/bindings/containers/mount.go:12-29 | pkg/bindings/images/images.go:108-125 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) pkg/specgen/namespaces.go:152 — pkg/specgen/namespaces.go:152-186 | pkg/specgen/namespaces.go:201-226 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (26 corresponding lines) libpod/container_internal_freebsd.go:136 — libpod/container_internal_freebsd.go:136-161 | libpod/container_internal_linux.go:177-208 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) libpod/sqlite_state.go:1578 — libpod/sqlite_state.go:1578-1603 | libpod/sqlite_state.go:2390-2413 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) pkg/bindings/containers/clone.go:15 — pkg/bindings/containers/clone.go:15-38 | pkg/bindings/containers/exec.go:56-80 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×2
  • Edited copy of a member (21 corresponding lines) pkg/bindings/containers/containers.go:26 — pkg/bindings/containers/containers.go:26-46 | pkg/bindings/network/network.go:114-134 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) pkg/domain/infra/abi/containers.go:616 — pkg/domain/infra/abi/containers.go:616-636 | pkg/domain/infra/abi/pods.go:407-427 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 21+ corresponding lines) cmd/podman/machine/restart.go:43 — cmd/podman/machine/restart.go:43-67 | cmd/podman/machine/start.go:47-70 | cmd/podman/machine/stop.go:33-53 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 21+ corresponding lines) libpod/sqlite_state.go:525 — libpod/sqlite_state.go:525-546 | libpod/sqlite_state.go:550-571 | libpod/sqlite_state.go:1164-1184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) libpod/sqlite_state.go:1073 — libpod/sqlite_state.go:1073-1095 | libpod/sqlite_state.go:1496-1515 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) REDACTED:25 — REDACTED:25-44 | REDACTED:49-74 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 19+ corresponding lines) libpod/plugin/volume_api.go:266 — libpod/plugin/volume_api.go:266-284 | libpod/plugin/volume_api.go:353-371 | libpod/plugin/volume_api.go:447-465 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) pkg/bindings/artifacts/add.go:47 — pkg/bindings/artifacts/add.go:47-65 | pkg/bindings/artifacts/inspect.go:11-29 | pkg/bindings/artifacts/remove.go:12-35 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 18+ corresponding lines) · ×2
  • Edited copies of one member (5 members, 18+ corresponding lines) pkg/bindings/containers/containers.go:52 — pkg/bindings/containers/containers.go:52-72 | pkg/bindings/network/network.go:91-111 | pkg/bindings/network/network.go:215-236 | pkg/bindings/secrets/secrets.go:71-90 | pkg/bindings/volumes/volumes.go:83-100 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
  • Edited copies of one member (5 members, 18+ corresponding lines) pkg/bindings/containers/healthcheck.go:13 — pkg/bindings/containers/healthcheck.go:13-30 | pkg/bindings/containers/mount.go:52-69 | pkg/bindings/system/system.go:153-170 | pkg/bindings/volumes/volumes.go:17-39 | pkg/bindings/volumes/volumes.go:42-59 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) libpod/container_api.go:539 — libpod/container_api.go:539-557 | libpod/container_api.go:560-575 | libpod/container_api.go:579-595 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) libpod/runtime_ctr.go:1263 — libpod/runtime_ctr.go:1263-1281 | libpod/runtime_pod.go:83-101 | pkg/ps/ps.go:152-167 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) cmd/podman/artifact/inspect.go:28 — cmd/podman/artifact/inspect.go:28-47 | cmd/podman/containers/inspect.go:27-41 | cmd/podman/images/inspect.go:27-38 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) cmd/podman/common/completion.go:1015 — cmd/podman/common/completion.go:1015-1031 | cmd/podman/common/completion.go:1034-1052 | cmd/podman/common/completion.go:1914-1925 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 7+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 7+ corresponding lines) cmd/podman/containers/rm.go:178 — cmd/podman/containers/rm.go:178-188 | cmd/podman/networks/rm.go:84-90 | cmd/podman/volumes/rm.go:86-92 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 7+ corresponding lines) pkg/machine/env/dir.go:99 — pkg/machine/env/dir.go:99-106 | REDACTED:227-233 | pkg/util/utils_windows.go:33-40 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 13+ corresponding lines) libpod/sqlite_state.go:2450 — libpod/sqlite_state.go:2450-2468 | libpod/sqlite_state_internal.go:637-649 | libpod/sqlite_state_internal.go:656-668 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 13+ corresponding lines) cmd/podman/utils/utils.go:35 — cmd/podman/utils/utils.go:35-48 | cmd/podman/utils/utils.go:50-62 | cmd/podman/utils/utils.go:64-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/bindings/artifacts/list.go:12 — pkg/bindings/artifacts/list.go:12-30 | pkg/bindings/images/images.go:127-140 | pkg/bindings/system/info.go:12-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) pkg/bindings/network/network.go:54 — pkg/bindings/network/network.go:54-70 | pkg/bindings/volumes/volumes.go:104-120 | pkg/bindings/volumes/volumes.go:158-171 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) pkg/machine/wsl/machine.go:422 — pkg/machine/wsl/machine.go:422-431 | pkg/machine/wsl/machine.go:433-445 | pkg/machine/wsl/machine.go:447-456 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) internal/domain/infra/abi/testing.go:191 — internal/domain/infra/abi/testing.go:191-200 | internal/domain/infra/abi/testing.go:202-211 | internal/domain/infra/abi/testing.go:213-222 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 11+ corresponding lines) cmd/podman/parse/filters.go:9 — cmd/podman/parse/filters.go:9-19 | pkg/domain/utils/utils.go:46-56 | pkg/specgen/generate/container.go:130-140 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) libpod/container.go:1520 — libpod/container.go:1520-1530 | libpod/container_api.go:1223-1234 | libpod/container_inspect.go:41-52 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) REDACTED:641 — REDACTED:641-660 | libpod/oci_conmon_exec_common.go:624-643 — 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:925 — libpod/sqlite_state.go:925-944 | libpod/sqlite_state.go:1672-1691 — both copies are in the same file, so extract the 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 · Duplicated block (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) REDACTED:1601 — REDACTED:1601-1619 | REDACTED:1687-1706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1601` 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:1444 — pkg/domain/infra/abi/containers.go:1444-1462 | 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • 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:281 — pkg/api/handlers/libpod/artifacts.go:281-299 | pkg/api/handlers/libpod/images.go:466-484 — 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:281` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • 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:1470 — pkg/domain/infra/abi/containers.go:1470-1480 | pkg/domain/infra/abi/containers.go:1577-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 `pkg/domain/infra/abi/containers.go:1470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×2
  • 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:762 — pkg/api/handlers/compat/containers.go:762-766 | 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:762` 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.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • 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 (8 lines × 6) pkg/bindings/artifacts/exists.go:12 — pkg/bindings/artifacts/exists.go:12-19 | pkg/bindings/images/images.go:23-30 | pkg/bindings/manifests/manifests.go:66-73 | pkg/bindings/network/network.go:201-208 | pkg/bindings/secrets/secrets.go:93-100 | pkg/bindings/volumes/volumes.go:124-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • 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.
D1 · Cyclomatic Complexity · specgenutil.FillOutSpecGen (cyclomatic 208) · ×1
  • specgenutil.FillOutSpecGen (cyclomatic 208) pkg/specgenutil/specgen.go:334 — specgenutil.FillOutSpecGen has cyclomatic complexity 208 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.generateSpec (cyclomatic 157) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.playKubePod (cyclomatic 129) · ×1
  • ContainerEngine.playKubePod (cyclomatic 129) pkg/domain/infra/abi/play.go:737 — 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.
D1 · Cyclomatic Complexity · images.prepareParams (cyclomatic 118) · ×1
  • images.prepareParams (cyclomatic 118) REDACTED:135 — images.prepareParams has cyclomatic complexity 118 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · generate.createContainerOptions (cyclomatic 111) · ×1
  • generate.createContainerOptions (cyclomatic 111) pkg/specgen/generate/container_create.go:389 — generate.createContainerOptions has cyclomatic complexity 111 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.restore (cyclomatic 105) · ×1
  • Container.restore (cyclomatic 105) REDACTED:1696 — Container.restore has cyclomatic complexity 105 (threshold 15). Of this number, 98 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kube.ToSpecGen (cyclomatic 104) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.setupContainer (cyclomatic 98) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.namespaceOptions (cyclomatic 97) · ×1
  • 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.
D1 · Cyclomatic Complexity · common.buildFlagsWrapperToOptions (cyclomatic 96) · ×1
  • common.buildFlagsWrapperToOptions (cyclomatic 96) cmd/podman/common/build.go:303 — common.buildFlagsWrapperToOptions has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · compat.cliOpts (cyclomatic 92) · ×1
  • compat.cliOpts (cyclomatic 92) pkg/api/handlers/compat/containers_create.go:247 — compat.cliOpts has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generate.MakeContainer (cyclomatic 91) · ×1
  • generate.MakeContainer (cyclomatic 91) pkg/specgen/generate/container_create.go:34 — generate.MakeContainer has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · compat.createBuildOptions (cyclomatic 88) · ×1
  • compat.createBuildOptions (cyclomatic 88) pkg/api/handlers/compat/images_build.go:407 — compat.createBuildOptions has cyclomatic complexity 88 (threshold 15). Of this number, 84 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.
D1 · Cyclomatic Complexity · filters.GenerateContainerFilterFuncs (cyclomatic 85) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.removeContainer (cyclomatic 80) · ×1
  • Runtime.removeContainer (cyclomatic 80) libpod/runtime_ctr.go:704 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.PlayKube (cyclomatic 77) · ×1
  • ContainerEngine.PlayKube (cyclomatic 77) pkg/domain/infra/abi/play.go:238 — ContainerEngine.PlayKube has cyclomatic complexity 77 (threshold 15). Of this number, 69 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.
D1 · Cyclomatic Complexity · util.processOptionsInternal (cyclomatic 72) · ×1
  • util.processOptionsInternal (cyclomatic 72) pkg/util/mount_opts.go:36 — util.processOptionsInternal has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · libpod.makeRuntime (cyclomatic 69) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.validate (cyclomatic 66) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgenutil.parseMountOptions (cyclomatic 66) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.CompleteSpec (cyclomatic 64) · ×1
  • generate.CompleteSpec (cyclomatic 64) pkg/specgen/generate/container.go:144 — generate.CompleteSpec has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · quadlet.ConvertContainer (cyclomatic 63) · ×1
  • 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.
D1 · Cyclomatic Complexity · common.NetFlagsToNetOptions (cyclomatic 62) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.makeBindMounts (cyclomatic 58) · ×1
  • Container.makeBindMounts (cyclomatic 58) REDACTED:2154 — 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.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.createOCIContainer (cyclomatic 56) · ×1
  • ConmonOCIRuntime.createOCIContainer (cyclomatic 56) REDACTED:1027 — 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.
D1 · Cyclomatic Complexity · filters.GenerateExternalContainerFilterFuncs (cyclomatic 55) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.CreateInit (cyclomatic 53) · ×1
  • containers.CreateInit (cyclomatic 53) cmd/podman/containers/create.go:234 — containers.CreateInit has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.mountStorage (cyclomatic 51) · ×1
  • Container.mountStorage (cyclomatic 51) libpod/container_internal.go:1750 — 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.
D1 · Cyclomatic Complexity · containers.Attach (cyclomatic 51) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.newVolume (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · shim.startLocked (cyclomatic 50) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.ConfigToSpec (cyclomatic 49) · ×1
  • generate.ConfigToSpec (cyclomatic 49) pkg/specgen/generate/container.go:391 — 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.
D1 · Cyclomatic Complexity · parser.extractFirstWord (cyclomatic 48) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.ManifestModify (cyclomatic 47) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.finalizeMounts (cyclomatic 47) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.Reset (cyclomatic 46) · ×1
  • 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.
D1 · Cyclomatic Complexity · SpecGenerator.Validate (cyclomatic 45) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.ImagesPull (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.restore (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.WaitForConditionWithInterval (cyclomatic 43) · ×1
  • Container.WaitForConditionWithInterval (cyclomatic 43) libpod/container_api.go:737 — Container.WaitForConditionWithInterval has cyclomatic complexity 43 (threshold 15). Of this number, 20 points are the body's own statements and 23 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filters.GeneratePodFilterFunc (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · infra.getRuntime (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · rootless.becomeRootInUserNS (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · kube.setupSecurityContext (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.executeContainerTemplate (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · parser.cUnescapeOne (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.persistentPreRunE (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.run (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.containerToV1Container (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.update (cyclomatic 42) · ×1
  • Container.update (cyclomatic 42) libpod/container_internal.go:2824 — Container.update has cyclomatic complexity 42 (threshold 15). Of this number, 41 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.readFromJournal (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.GenerateKube (cyclomatic 42) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.generatePasswdAndGroup (cyclomatic 41) · ×1
  • Container.generatePasswdAndGroup (cyclomatic 41) REDACTED:2995 — 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.
D1 · Cyclomatic Complexity · checkpoint.CRImportCheckpoint (cyclomatic 41) · ×1
  • 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.
D1 · Cyclomatic Complexity · kube.play (cyclomatic 40) · ×1
  • kube.play (cyclomatic 40) cmd/podman/kube/play.go:239 — kube.play has cyclomatic complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · libpod.GetLimits (cyclomatic 40) · ×1
  • libpod.GetLimits (cyclomatic 40) libpod/oci_conmon_linux.go:185 — 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.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.HTTPAttach (cyclomatic 40) · ×1
  • ConmonOCIRuntime.HTTPAttach (cyclomatic 40) REDACTED:478 — 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.
D1 · Cyclomatic Complexity · utils.ExecuteTransfer (cyclomatic 40) · ×1
  • 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.
D1 · Cyclomatic Complexity · shim.Init (cyclomatic 40) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.ParsePortMapping (cyclomatic 40) · ×1
  • 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.
D1 · Cyclomatic Complexity · common.ParseBuildOpts (cyclomatic 39) · ×1
  • common.ParseBuildOpts (cyclomatic 39) cmd/podman/common/build.go:146 — common.ParseBuildOpts has cyclomatic complexity 39 (threshold 15). Of this number, 35 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContainerEngine.PlayKubeDown (cyclomatic 39) · ×1
  • ContainerEngine.PlayKubeDown (cyclomatic 39) pkg/domain/infra/abi/play.go:1867 — 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.
D1 · Cyclomatic Complexity · compat.LibpodToContainerJSON (cyclomatic 38) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.runHealthCheck (cyclomatic 37) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.checkpoint (cyclomatic 36) · ×1
  • Container.checkpoint (cyclomatic 36) REDACTED:1452 — Container.checkpoint has cyclomatic complexity 36 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · compat.LibpodToContainer (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.PushImage (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgen.GenVolumeMounts (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · inspector.inspect (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.simplePodWithV1Containers (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.ExecStartAndAttach (cyclomatic 35) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.nTar (cyclomatic 35) · ×1
  • images.nTar (cyclomatic 35) REDACTED:1146 — 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 1161, 1310). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · images.prepareRemoteRequestBody (cyclomatic 34) · ×1
  • images.prepareRemoteRequestBody (cyclomatic 34) REDACTED:704 — 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.
D1 · Cyclomatic Complexity · specgenutil.parseVolumes (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgenutil.mounts (cyclomatic 34) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.Commit (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.QuadletInstall (cyclomatic 33) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.process (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.copyFromArchive (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.fixVolumePermissionsUnlocked (cyclomatic 32) · ×1
  • Container.fixVolumePermissionsUnlocked (cyclomatic 32) REDACTED:3183 — 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.
D1 · Cyclomatic Complexity · SQLiteState.Refresh (cyclomatic 32) · ×1
  • SQLiteState.Refresh (cyclomatic 32) libpod/sqlite_state.go:129 — 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.
D1 · Cyclomatic Complexity · generate.SpecGenToOCI (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · manifests.Modify (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · abi.getContainers (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgen.ParseNetworkFlag (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.MapSpec (cyclomatic 31) · ×1
  • generate.MapSpec (cyclomatic 31) pkg/specgen/generate/pod_create.go:178 — 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.
D1 · Cyclomatic Complexity · specgenutil.GetResources (cyclomatic 31) · ×1
  • specgenutil.GetResources (cyclomatic 31) pkg/specgenutil/specgen.go:1341 — 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.
D1 · Cyclomatic Complexity · Container.generateInspectContainerHostConfig (cyclomatic 30) · ×1
  • Container.generateInspectContainerHostConfig (cyclomatic 30) libpod/container_inspect.go:491 — Container.generateInspectContainerHostConfig has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.NetworkConnect (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · Pod.podWithContainers (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.removeVolume (cyclomatic 30) · ×1
  • 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.
D1 · Cyclomatic Complexity · SQLiteState.ValidateDBConfig (cyclomatic 30) · ×1
  • SQLiteState.ValidateDBConfig (cyclomatic 30) libpod/sqlite_state.go:317 — 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.
D1 · Cyclomatic Complexity · containers.port (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.attachExecHTTP (cyclomatic 29) · ×1
  • libpod.attachExecHTTP (cyclomatic 29) libpod/oci_conmon_exec_common.go:481 — 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.
D1 · Cyclomatic Complexity · Container.exportCheckpoint (cyclomatic 29) · ×1
  • Container.exportCheckpoint (cyclomatic 29) REDACTED:1207 — Container.exportCheckpoint has cyclomatic complexity 29 (threshold 15). Of this number, 24 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.
D1 · Cyclomatic Complexity · events.generateEventFilter (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.SystemCheck (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.UpdateContainer (cyclomatic 29) · ×1
  • compat.UpdateContainer (cyclomatic 29) pkg/api/handlers/compat/containers.go:786 — 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.
D1 · Cyclomatic Complexity · compat.CreateContainer (cyclomatic 29) · ×1
  • compat.CreateContainer (cyclomatic 29) pkg/api/handlers/compat/containers_create.go:59 — compat.CreateContainer has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · compat.LogsFromContainer (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerMount (cyclomatic 29) · ×1
  • ContainerEngine.ContainerMount (cyclomatic 29) pkg/domain/infra/abi/containers.go:1443 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.QuadletRemove (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · PodSpecGenerator.Validate (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · connection.add (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.parent (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.evictContainer (cyclomatic 28) · ×1
  • Runtime.evictContainer (cyclomatic 28) libpod/runtime_ctr.go:1077 — 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.
D1 · Cyclomatic Complexity · Runtime.removePod (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.GetDefaultNamespaceMode (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · validate.CheckAllLatestAndIDFile (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.execStartAndAttach (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.setupStorage (cyclomatic 27) · ×1
  • Container.setupStorage (cyclomatic 27) libpod/container_internal.go:448 — Container.setupStorage has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.NetworkDisconnect (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · SQLiteState.addContainer (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.CreateNetwork (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · util.ParseIDMapping (cyclomatic 27) · ×1
  • util.ParseIDMapping (cyclomatic 27) REDACTED:961 — 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.
D1 · Cyclomatic Complexity · containers.copyFromContainer (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.copyToContainer (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.systemd (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · machine.initMachine (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · BoltState.GetNetworks (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.ConvertV1PodToYAMLPod (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.getContainerInspectData (cyclomatic 26) · ×1
  • Container.getContainerInspectData (cyclomatic 26) libpod/container_inspect.go:65 — 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.
D1 · Cyclomatic Complexity · Container.prepareProcessExec (cyclomatic 26) · ×1
  • Container.prepareProcessExec (cyclomatic 26) libpod/oci_conmon_exec_common.go:669 — Container.prepareProcessExec 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.
D1 · Cyclomatic Complexity · EventLogFile.Read (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.handleBuildContexts (cyclomatic 26) · ×1
  • compat.handleBuildContexts (cyclomatic 26) pkg/api/handlers/compat/images_build.go:1195 — 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.
D1 · Cyclomatic Complexity · images.build (cyclomatic 26) · ×1
  • images.build (cyclomatic 26) REDACTED:1021 — 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.
D1 · Cyclomatic Complexity · infra.ParseIDMapping (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgenutil.setNamespaces (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.ps (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.imageSearch (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · system.restService (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · volumes.prune (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.mergeDBConfig (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · bindings.sshClient (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.MakePod (cyclomatic 25) · ×1
  • generate.MakePod (cyclomatic 25) pkg/specgen/generate/pod_create.go:23 — generate.MakePod has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generate.executePodTemplate (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · quadlet.ConvertVolume (cyclomatic 25) · ×1
  • quadlet.ConvertVolume (cyclomatic 25) pkg/systemd/quadlet/quadlet.go:1136 — 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.
D1 · Cyclomatic Complexity · EventJournalD.Read (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.getContainerNetworkInfo (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerStart (cyclomatic 24) · ×1
  • ContainerEngine.ContainerStart (cyclomatic 24) pkg/domain/infra/abi/containers.go:1036 — ContainerEngine.ContainerStart has cyclomatic complexity 24 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerRun (cyclomatic 24) · ×1
  • ContainerEngine.ContainerRun (cyclomatic 24) pkg/domain/infra/abi/containers.go:1206 — 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.
D1 · Cyclomatic Complexity · specgenutil.parseSecrets (cyclomatic 24) · ×1
  • specgenutil.parseSecrets (cyclomatic 24) pkg/specgenutil/specgen.go:1175 — 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.
D1 · Cyclomatic Complexity · quadlet.ConvertKube (cyclomatic 24) · ×1
  • quadlet.ConvertKube (cyclomatic 24) pkg/systemd/quadlet/quadlet.go:1264 — 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.
D1 · Cyclomatic Complexity · common.DefineCreateFlags (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.checkpoint (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.create (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.imagePush (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · manifest.push (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.ExecHTTPStartAndAttach (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.cleanup (cyclomatic 23) · ×1
  • Container.cleanup (cyclomatic 23) libpod/container_internal.go:2227 — Container.cleanup has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.sharedConmonArgs (cyclomatic 23) · ×1
  • ConmonOCIRuntime.sharedConmonArgs (cyclomatic 23) REDACTED:1338 — ConmonOCIRuntime.sharedConmonArgs 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.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.startExec (cyclomatic 23) · ×1
  • ConmonOCIRuntime.startExec (cyclomatic 23) libpod/oci_conmon_exec_common.go:329 — 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.
D1 · Cyclomatic Complexity · Runtime.Migrate (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.NewPod (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.StatsContainer (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.processBuildContext (cyclomatic 23) · ×1
  • compat.processBuildContext (cyclomatic 23) pkg/api/handlers/compat/images_build.go:269 — 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.
D1 · Cyclomatic Complexity · filters.GenerateVolumeFilters (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.SystemDf (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.getVolumesFrom (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · kube.ToPodOpt (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · kube.VolumeFromHostPath (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · util.parseTriple (cyclomatic 23) · ×1
  • util.parseTriple (cyclomatic 23) REDACTED:357 — 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.
D1 · Cyclomatic Complexity · containers.exec (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.generateKubeSecurityContext (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.mountNamedVolume (cyclomatic 22) · ×1
  • Container.mountNamedVolume (cyclomatic 22) libpod/container_internal.go:1953 — 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.
D1 · Cyclomatic Complexity · Container.cleanupStorage (cyclomatic 22) · ×1
  • Container.cleanupStorage (cyclomatic 22) libpod/container_internal.go:2074 — 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.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.Attach (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.migrateDB (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · SQLiteState.RemovePodContainers (cyclomatic 22) · ×1
  • SQLiteState.RemovePodContainers (cyclomatic 22) libpod/sqlite_state.go:1848 — 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.
D1 · Cyclomatic Complexity · compat.ListContainers (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.CommitContainer (cyclomatic 22) · ×1
  • libpod.CommitContainer (cyclomatic 22) pkg/api/handlers/libpod/images.go:558 — 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.
D1 · Cyclomatic Complexity · libpod.PushImage (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.Push (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.Sign (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerClone (cyclomatic 22) · ×1
  • ContainerEngine.ContainerClone (cyclomatic 22) pkg/domain/infra/abi/containers.go:1753 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.SystemPrune (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · listLocal.build (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ps.GetContainerLists (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · ps.ListContainerBatch (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · trust.AddPolicyEntries (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.validateStart (cyclomatic 21) · ×1
  • containers.validateStart (cyclomatic 21) cmd/podman/containers/start.go:91 — containers.validateStart has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · network.networkCreate (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.startNode (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.httpAttachNonTerminalCopy (cyclomatic 21) · ×1
  • libpod.httpAttachNonTerminalCopy (cyclomatic 21) REDACTED:1623 — 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.
D1 · Cyclomatic Complexity · Container.execLightweight (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.TopContainer (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.GetEvents (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · abi.getAllQuadlets (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · parse.VolumeOptions (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.containerStopImpl (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · emulation.parseBinfmtMisc (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · Farm.Build (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.DevicesFromPath (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.imagePull (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.podmanTopInner (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.init (cyclomatic 20) · ×1
  • Container.init (cyclomatic 20) libpod/container_internal.go:1011 — Container.init has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Pod.Inspect (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.RemoveStorageContainer (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · Volume.mount (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.ManifestCreate (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.ManifestPush (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · utils.CompatPull (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.Mount (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.ManifestPush (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.NetworkRm (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.playKubePVC (cyclomatic 20) · ×1
  • ContainerEngine.playKubePVC (cyclomatic 20) pkg/domain/infra/abi/play.go:1516 — 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.
D1 · Cyclomatic Complexity · quadlet.ConvertBuild (cyclomatic 20) · ×1
  • quadlet.ConvertBuild (cyclomatic 20) pkg/systemd/quadlet/quadlet.go:1447 — 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.
D1 · Cyclomatic Complexity · common.AutocompleteFormat (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.pullImage (cyclomatic 19) · ×1
  • containers.pullImage (cyclomatic 19) cmd/podman/containers/create.go:358 — 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.
D1 · Cyclomatic Complexity · manifest.add (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · localapi.CheckIfImageBuildPathsOnRunningMachine (cyclomatic 19) · ×1
  • localapi.CheckIfImageBuildPathsOnRunningMachine (cyclomatic 19) internal/localapi/utils.go:166 — 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.
D1 · Cyclomatic Complexity · Container.NamespaceMode (cyclomatic 19) · ×1
  • Container.NamespaceMode (cyclomatic 19) libpod/container.go:1538 — 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.
D1 · Cyclomatic Complexity · Container.WaitForExit (cyclomatic 19) · ×1
  • Container.WaitForExit (cyclomatic 19) libpod/container_api.go:606 — 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.
D1 · Cyclomatic Complexity · Container.resolvePath (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · events.newEventFromJournalEntry (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Event.toHumanReadable (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Pod.stopWithTimeout (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.refresh (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · SQLiteState.RenameVolume (cyclomatic 19) · ×1
  • SQLiteState.RenameVolume (cyclomatic 19) libpod/sqlite_state.go:1410 — 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.
D1 · Cyclomatic Complexity · libpod.KubePlay (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · artifacts.Extract (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · MachineConfig.Remove (cyclomatic 19) · ×1
  • MachineConfig.Remove (cyclomatic 19) pkg/machine/vmconfigs/machine.go:146 — 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 186). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · specgenutil.MakeHealthCheckFromCli (cyclomatic 19) · ×1
  • specgenutil.MakeHealthCheckFromCli (cyclomatic 19) pkg/specgenutil/specgen.go:1033 — 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.
D1 · Cyclomatic Complexity · HyperVStubber.CreateVM (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.copyContainerToContainer (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.loadTemplateInstances (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.transformSwagger (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.Attach (cyclomatic 18) · ×1
  • Container.Attach (cyclomatic 18) libpod/container_api.go:193 — 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.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.StopContainer (cyclomatic 18) · ×1
  • ConmonOCIRuntime.StopContainer (cyclomatic 18) REDACTED:338 — 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.
D1 · Cyclomatic Complexity · SQLiteState.RemovePod (cyclomatic 18) · ×1
  • SQLiteState.RemovePod (cyclomatic 18) libpod/sqlite_state.go:1773 — 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.
D1 · Cyclomatic Complexity · SQLiteState.networkModify (cyclomatic 18) · ×1
  • SQLiteState.networkModify (cyclomatic 18) libpod/sqlite_state_internal.go:574 — 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.
D1 · Cyclomatic Complexity · compat.ExecStartHandler (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · updater.updateUnit (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.Pull (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.ManifestAnnotate (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerStats (cyclomatic 18) · ×1
  • ContainerEngine.ContainerStats (cyclomatic 18) pkg/domain/infra/abi/containers.go:1650 — 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 1679, 1660). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerRunlabel (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.PodClone (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · tunnel.parseBuildOutput (cyclomatic 18) · ×1
  • tunnel.parseBuildOutput (cyclomatic 18) REDACTED:551 — tunnel.parseBuildOutput has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerRm (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.PodConfigToSpec (cyclomatic 18) · ×1
  • generate.PodConfigToSpec (cyclomatic 18) pkg/specgen/generate/pod_create.go:279 — 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.
D1 · Cyclomatic Complexity · quadlet.handleSetWorkingDirectory (cyclomatic 18) · ×1
  • quadlet.handleSetWorkingDirectory (cyclomatic 18) pkg/systemd/quadlet/quadlet.go:2086 — 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.
D1 · Cyclomatic Complexity · util.ParseDockerignore (cyclomatic 18) · ×1
  • util.ParseDockerignore (cyclomatic 18) REDACTED:55 — 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.
D1 · Cyclomatic Complexity · farm.build (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · farm.rm (cyclomatic 17) · ×1
  • farm.rm (cyclomatic 17) cmd/podman/farm/remove.go:47 — farm.rm has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 49). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · farm.farmUpdate (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · system.printSystemCheckResults (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · connection.inspect (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · registry.StartWithOptions (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.readConmonPipeData (cyclomatic 17) · ×1
  • libpod.readConmonPipeData (cyclomatic 17) REDACTED:1470 — libpod.readConmonPipeData 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.
D1 · Cyclomatic Complexity · Container.handleRestartPolicy (cyclomatic 17) · ×1
  • Container.handleRestartPolicy (cyclomatic 17) libpod/container_internal.go:272 — Container.handleRestartPolicy 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.
D1 · Cyclomatic Complexity · Container.restartWithTimeout (cyclomatic 17) · ×1
  • Container.restartWithTimeout (cyclomatic 17) libpod/container_internal.go:1682 — Container.restartWithTimeout has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteState.AddPod (cyclomatic 17) · ×1
  • SQLiteState.AddPod (cyclomatic 17) libpod/sqlite_state.go:1703 — 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.
D1 · Cyclomatic Complexity · compat.CreateVolume (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.InstallQuadlets (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · updater.assembleTasks (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.Commit (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.Logs (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · images.Push (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · manifests.Push (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · abi.getKubePods (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.List (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ImageEngine.remoteManifestInspect (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · tunnel.getContainersAndInputByContext (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerStart (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · emulation.registeredBinfmtMisc (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · shim.Remove (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · specgen.SetupUserNS (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.applyHealthCheckOverrides (cyclomatic 17) · ×1
  • generate.applyHealthCheckOverrides (cyclomatic 17) pkg/specgen/generate/container.go:67 — 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.
D1 · Cyclomatic Complexity · NotifyProxy.listen (cyclomatic 17) · ×1
  • NotifyProxy.listen (cyclomatic 17) pkg/systemd/notifyproxy/notifyproxy.go:189 — 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 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.
D1 · Cyclomatic Complexity · parser.escapeString (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · quadlet.handleUserRemap (cyclomatic 17) · ×1
  • quadlet.handleUserRemap (cyclomatic 17) pkg/systemd/quadlet/quadlet.go:1820 — 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.
D1 · Cyclomatic Complexity · util.breakInsert (cyclomatic 17) · ×1
  • util.breakInsert (cyclomatic 17) REDACTED:438 — 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.
D1 · Cyclomatic Complexity · HyperVStubber.SetProviderAttrs (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · vsock.loadHVSockRegistryEntries (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.portsToString (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.GetChangedHealthCheckConfiguration (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · containers.update (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · system.prune (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · main.loadUnitDropins (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.detectCycles (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.exec (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Container.stopInternal (cyclomatic 16) · ×1
  • Container.stopInternal (cyclomatic 16) libpod/container_internal.go:1442 — 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.
D1 · Cyclomatic Complexity · Container.prepare (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · logs.getTailLog (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.RenumberLocks (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Runtime.UpdateVolumePlugins (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · SQLiteState.AllContainers (cyclomatic 16) · ×1
  • SQLiteState.AllContainers (cyclomatic 16) libpod/sqlite_state.go:881 — 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.
D1 · Cyclomatic Complexity · SQLiteState.AddVolume (cyclomatic 16) · ×1
  • SQLiteState.AddVolume (cyclomatic 16) libpod/sqlite_state.go:2047 — 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.
D1 · Cyclomatic Complexity · compat.AttachContainer (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · compat.SearchImages (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · libpod.PodTop (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Connection.DoRequest (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · util.ToParams (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.KubeApply (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerCleanup (cyclomatic 16) · ×1
  • ContainerEngine.ContainerCleanup (cyclomatic 16) pkg/domain/infra/abi/containers.go:1370 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerUnmount (cyclomatic 16) · ×1
  • ContainerEngine.ContainerUnmount (cyclomatic 16) pkg/domain/infra/abi/containers.go:1552 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.buildImageFromContainerfile (cyclomatic 16) · ×1
  • ContainerEngine.buildImageFromContainerfile (cyclomatic 16) pkg/domain/infra/abi/play.go:1346 — ContainerEngine.buildImageFromContainerfile has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContainerEngine.installQuadlet (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerRestore (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerRun (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · Farm.Schedule (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · shim.Reset (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.createPodOptions (cyclomatic 16) · ×1
  • generate.createPodOptions (cyclomatic 16) pkg/specgen/generate/pod_create.go:123 — 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.
D1 · Cyclomatic Complexity · specgenutil.getIOLimits (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · generate.PodUnits (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · util.parseAutoTriple (cyclomatic 16) · ×1
  • util.parseAutoTriple (cyclomatic 16) REDACTED:819 — 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.
D1 · Cyclomatic Complexity · EventJournalD.Write (cyclomatic 16) · ×1
  • 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.
D2 · Cognitive Complexity · Container.generateSpec (cognitive 329) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.FillOutSpecGen (cognitive 249) · ×1
  • specgenutil.FillOutSpecGen (cognitive 249) pkg/specgenutil/specgen.go:334 — specgenutil.FillOutSpecGen has cognitive complexity 249 (threshold 15). Drivers by points: if/else 140 (192 pts), boolean chains 44, loops 8 (9 pts), match/switch 2 (4 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContainerEngine.playKubePod (cognitive 231) · ×1
  • ContainerEngine.playKubePod (cognitive 231) pkg/domain/infra/abi/play.go:737 — 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.
D2 · Cognitive Complexity · Runtime.setupContainer (cognitive 208) · ×1
  • 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.
D2 · Cognitive Complexity · Container.restore (cognitive 193) · ×1
  • Container.restore (cognitive 193) REDACTED:1696 — Container.restore has cognitive complexity 193 (threshold 15). Drivers by points: if/else 84 (162 pts), loops 7 (18 pts), boolean chains 13 (nesting depth added 89). Of this number, 185 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContainerEngine.PlayKube (cognitive 170) · ×1
  • ContainerEngine.PlayKube (cognitive 170) pkg/domain/infra/abi/play.go:238 — ContainerEngine.PlayKube has cognitive complexity 170 (threshold 15). Drivers by points: if/else 55 (144 pts), loops 6 (14 pts), match/switch 3 (7 pts), boolean chains 5 (nesting depth added 101). Of this number, 152 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.
D2 · Cognitive Complexity · generate.createContainerOptions (cognitive 169) · ×1
  • generate.createContainerOptions (cognitive 169) pkg/specgen/generate/container_create.go:389 — generate.createContainerOptions has cognitive complexity 169 (threshold 15). Drivers by points: if/else 83 (139 pts), loops 10 (16 pts), boolean chains 13, match/switch 1 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compat.cliOpts (cognitive 165) · ×1
  • compat.cliOpts (cognitive 165) pkg/api/handlers/compat/containers_create.go:247 — compat.cliOpts has cognitive complexity 165 (threshold 15). Drivers by points: if/else 55 (120 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.
D2 · Cognitive Complexity · filters.GenerateContainerFilterFuncs (cognitive 159) · ×1
  • 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.
D2 · Cognitive Complexity · images.prepareParams (cognitive 147) · ×1
  • images.prepareParams (cognitive 147) REDACTED:135 — images.prepareParams has cognitive complexity 147 (threshold 15). Drivers by points: if/else 96 (124 pts), loops 14 (17 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.
D2 · Cognitive Complexity · Runtime.removeContainer (cognitive 145) · ×1
  • Runtime.removeContainer (cognitive 145) libpod/runtime_ctr.go:704 — 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.
D2 · Cognitive Complexity · generate.namespaceOptions (cognitive 145) · ×1
  • 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.
D2 · Cognitive Complexity · kube.ToSpecGen (cognitive 144) · ×1
  • 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.
D2 · Cognitive Complexity · parser.extractFirstWord (cognitive 137) · ×1
  • 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.
D2 · Cognitive Complexity · generate.MakeContainer (cognitive 135) · ×1
  • generate.MakeContainer (cognitive 135) pkg/specgen/generate/container_create.go:34 — generate.MakeContainer has cognitive complexity 135 (threshold 15). Drivers by points: if/else 73 (119 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.
D2 · Cognitive Complexity · common.buildFlagsWrapperToOptions (cognitive 134) · ×1
  • common.buildFlagsWrapperToOptions (cognitive 134) cmd/podman/common/build.go:303 — common.buildFlagsWrapperToOptions has cognitive complexity 134 (threshold 15). Drivers by points: if/else 77 (116 pts), loops 7 (12 pts), boolean chains 4, match/switch 2 (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.
D2 · Cognitive Complexity · compat.createBuildOptions (cognitive 131) · ×1
  • compat.createBuildOptions (cognitive 131) pkg/api/handlers/compat/images_build.go:407 — compat.createBuildOptions has cognitive complexity 131 (threshold 15). Drivers by points: if/else 72 (111 pts), loops 6 (11 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 47). Of this number, 127 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · common.NetFlagsToNetOptions (cognitive 130) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.parseMountOptions (cognitive 127) · ×1
  • 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.
D2 · Cognitive Complexity · Container.makeBindMounts (cognitive 125) · ×1
  • Container.makeBindMounts (cognitive 125) REDACTED:2154 — 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.
D2 · Cognitive Complexity · libpod.makeRuntime (cognitive 124) · ×1
  • 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.
D2 · Cognitive Complexity · util.processOptionsInternal (cognitive 117) · ×1
  • util.processOptionsInternal (cognitive 117) pkg/util/mount_opts.go:36 — util.processOptionsInternal has cognitive complexity 117 (threshold 15). Drivers by points: if/else 43 (109 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate.ParsePortMapping (cognitive 108) · ×1
  • 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.
D2 · Cognitive Complexity · filters.GenerateExternalContainerFilterFuncs (cognitive 102) · ×1
  • 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.
D2 · Cognitive Complexity · generate.CompleteSpec (cognitive 102) · ×1
  • generate.CompleteSpec (cognitive 102) pkg/specgen/generate/container.go:144 — generate.CompleteSpec has cognitive complexity 102 (threshold 15). Drivers by points: if/else 47 (80 pts), loops 6 (10 pts), boolean chains 8, 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.
D2 · Cognitive Complexity · Runtime.newVolume (cognitive 93) · ×1
  • 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.
D2 · Cognitive Complexity · Container.WaitForConditionWithInterval (cognitive 92) · ×1
  • Container.WaitForConditionWithInterval (cognitive 92) libpod/container_api.go:737 — Container.WaitForConditionWithInterval has cognitive complexity 92 (threshold 15). Drivers by points: if/else 25 (74 pts), match/switch 4 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 55). Of this number, 24 points are the body's own statements and 68 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Container.validate (cognitive 92) · ×1
  • 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.
D2 · Cognitive Complexity · containers.Attach (cognitive 92) · ×1
  • 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.
D2 · Cognitive Complexity · Container.mountStorage (cognitive 90) · ×1
  • Container.mountStorage (cognitive 90) libpod/container_internal.go:1750 — 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.
D2 · Cognitive Complexity · specgen.GenVolumeMounts (cognitive 89) · ×1
  • 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.
D2 · Cognitive Complexity · main.persistentPreRunE (cognitive 88) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.simplePodWithV1Containers (cognitive 86) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.ManifestModify (cognitive 86) · ×1
  • 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.
D2 · Cognitive Complexity · images.nTar (cognitive 83) · ×1
  • images.nTar (cognitive 83) REDACTED:1146 — 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 1161, 1310). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · specgenutil.mounts (cognitive 82) · ×1
  • 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.
D2 · Cognitive Complexity · generate.executeContainerTemplate (cognitive 82) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.Reset (cognitive 81) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.GenerateKube (cognitive 79) · ×1
  • 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.
D2 · Cognitive Complexity · containers.CreateInit (cognitive 78) · ×1
  • containers.CreateInit (cognitive 78) cmd/podman/containers/create.go:234 — containers.CreateInit has cognitive complexity 78 (threshold 15). Drivers by points: if/else 33 (62 pts), boolean chains 13, loops 1 (3 pts) (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.
D2 · Cognitive Complexity · ConmonOCIRuntime.createOCIContainer (cognitive 77) · ×1
  • ConmonOCIRuntime.createOCIContainer (cognitive 77) REDACTED:1027 — 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.
D2 · Cognitive Complexity · generate.ConfigToSpec (cognitive 77) · ×1
  • generate.ConfigToSpec (cognitive 77) pkg/specgen/generate/container.go:391 — 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.
D2 · Cognitive Complexity · filters.GeneratePodFilterFunc (cognitive 75) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.GetLimits (cognitive 74) · ×1
  • libpod.GetLimits (cognitive 74) libpod/oci_conmon_linux.go:185 — 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.
D2 · Cognitive Complexity · checkpoint.CRImportCheckpoint (cognitive 73) · ×1
  • 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.
D2 · Cognitive Complexity · rootless.becomeRootInUserNS (cognitive 73) · ×1
  • 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.
D2 · Cognitive Complexity · Pod.podWithContainers (cognitive 72) · ×1
  • 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.
D2 · Cognitive Complexity · compat.PushImage (cognitive 72) · ×1
  • 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.
D2 · Cognitive Complexity · generate.finalizeMounts (cognitive 71) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.ConvertContainer (cognitive 71) · ×1
  • 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.
D2 · Cognitive Complexity · Container.copyFromArchive (cognitive 70) · ×1
  • 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.
D2 · Cognitive Complexity · Container.generatePasswdAndGroup (cognitive 70) · ×1
  • Container.generatePasswdAndGroup (cognitive 70) REDACTED:2995 — 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.
D2 · Cognitive Complexity · ConmonOCIRuntime.HTTPAttach (cognitive 69) · ×1
  • ConmonOCIRuntime.HTTPAttach (cognitive 69) REDACTED:478 — 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.
D2 · Cognitive Complexity · shim.startLocked (cognitive 69) · ×1
  • 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.
D2 · Cognitive Complexity · containers.ExecStartAndAttach (cognitive 68) · ×1
  • 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.
D2 · Cognitive Complexity · Container.fixVolumePermissionsUnlocked (cognitive 67) · ×1
  • Container.fixVolumePermissionsUnlocked (cognitive 67) REDACTED:3183 — 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.
D2 · Cognitive Complexity · common.ParseBuildOpts (cognitive 66) · ×1
  • common.ParseBuildOpts (cognitive 66) cmd/podman/common/build.go:146 — common.ParseBuildOpts has cognitive complexity 66 (threshold 15). Drivers by points: if/else 35 (58 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 24). Of this number, 61 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.
D2 · Cognitive Complexity · ContainerEngine.PlayKubeDown (cognitive 66) · ×1
  • ContainerEngine.PlayKubeDown (cognitive 66) pkg/domain/infra/abi/play.go:1867 — 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.
D2 · Cognitive Complexity · images.prepareRemoteRequestBody (cognitive 65) · ×1
  • images.prepareRemoteRequestBody (cognitive 65) REDACTED:704 — 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.
D2 · Cognitive Complexity · utils.ExecuteTransfer (cognitive 64) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.containerToV1Container (cognitive 63) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.QuadletRemove (cognitive 63) · ×1
  • 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.
D2 · Cognitive Complexity · Container.readFromJournal (cognitive 62) · ×1
  • 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.
D2 · Cognitive Complexity · abi.getContainers (cognitive 62) · ×1
  • 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.
D2 · Cognitive Complexity · Container.update (cognitive 61) · ×1
  • Container.update (cognitive 61) libpod/container_internal.go:2824 — Container.update has cognitive complexity 61 (threshold 15). Drivers by points: if/else 30 (51 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 22). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate.getVolumesFrom (cognitive 61) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.ImagesPull (cognitive 60) · ×1
  • 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.
D2 · Cognitive Complexity · bindings.sshClient (cognitive 60) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerStart (cognitive 60) · ×1
  • ContainerEngine.ContainerStart (cognitive 60) pkg/domain/infra/abi/containers.go:1036 — ContainerEngine.ContainerStart has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (57 pts), boolean chains 2, loops 1 (nesting depth added 37). Of this number, 57 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · compat.TopContainer (cognitive 59) · ×1
  • 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.
D2 · Cognitive Complexity · compat.processBuildContext (cognitive 59) · ×1
  • compat.processBuildContext (cognitive 59) pkg/api/handlers/compat/images_build.go:269 — 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.
D2 · Cognitive Complexity · parse.VolumeOptions (cognitive 59) · ×1
  • 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.
D2 · Cognitive Complexity · compat.LibpodToContainer (cognitive 58) · ×1
  • 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.
D2 · Cognitive Complexity · compat.handleBuildContexts (cognitive 57) · ×1
  • compat.handleBuildContexts (cognitive 57) pkg/api/handlers/compat/images_build.go:1195 — 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.
D2 · Cognitive Complexity · kube.play (cognitive 56) · ×1
  • kube.play (cognitive 56) cmd/podman/kube/play.go:239 — kube.play has cognitive complexity 56 (threshold 15). Drivers by points: if/else 31 (48 pts), boolean chains 6, loops 2 (nesting depth added 17). Of this number, 50 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · libpod.httpAttachNonTerminalCopy (cognitive 56) · ×1
  • libpod.httpAttachNonTerminalCopy (cognitive 56) REDACTED:1623 — 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.
D2 · Cognitive Complexity · Runtime.removeVolume (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · kube.setupSecurityContext (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · containers.run (cognitive 54) · ×1
  • 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.
D2 · Cognitive Complexity · Container.Commit (cognitive 53) · ×1
  • 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.
D2 · Cognitive Complexity · BoltState.GetNetworks (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.ConvertVolume (cognitive 52) · ×1
  • quadlet.ConvertVolume (cognitive 52) pkg/systemd/quadlet/quadlet.go:1136 — 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.
D2 · Cognitive Complexity · SpecGenerator.Validate (cognitive 51) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.parseVolumes (cognitive 51) · ×1
  • 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.
D2 · Cognitive Complexity · Container.generateInspectContainerHostConfig (cognitive 50) · ×1
  • Container.generateInspectContainerHostConfig (cognitive 50) libpod/container_inspect.go:491 — Container.generateInspectContainerHostConfig has cognitive complexity 50 (threshold 15). Drivers by points: if/else 29 (44 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Container.exportCheckpoint (cognitive 50) · ×1
  • Container.exportCheckpoint (cognitive 50) REDACTED:1207 — Container.exportCheckpoint has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (46 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). Of this number, 35 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.
D2 · Cognitive Complexity · Container.resolvePath (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.Sign (cognitive 50) · ×1
  • 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.
D2 · Cognitive Complexity · inspector.inspect (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.PodTop (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.QuadletInstall (cognitive 49) · ×1
  • 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.
D2 · Cognitive Complexity · system.restService (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · Container.checkpoint (cognitive 48) · ×1
  • Container.checkpoint (cognitive 48) REDACTED:1452 — Container.checkpoint has cognitive complexity 48 (threshold 15). Drivers by points: if/else 30 (41 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 12). Of this number, 44 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteState.ValidateDBConfig (cognitive 48) · ×1
  • SQLiteState.ValidateDBConfig (cognitive 48) libpod/sqlite_state.go:317 — SQLiteState.ValidateDBConfig has cognitive complexity 48 (threshold 15). Drivers by points: if/else 28 (47 pts), loops 1 (nesting depth added 19). Of this number, 33 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.
D2 · Cognitive Complexity · manifests.Modify (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · shim.Init (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.parseSecrets (cognitive 48) · ×1
  • specgenutil.parseSecrets (cognitive 48) pkg/specgenutil/specgen.go:1175 — 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.
D2 · Cognitive Complexity · Container.cleanup (cognitive 47) · ×1
  • Container.cleanup (cognitive 47) libpod/container_internal.go:2227 — Container.cleanup has cognitive complexity 47 (threshold 15). Drivers by points: if/else 24 (45 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compat.LogsFromContainer (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · compat.CreateNetwork (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · utils.CompatPull (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · infra.getRuntime (cognitive 47) · ×1
  • 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.
D2 · Cognitive Complexity · containers.port (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · compat.LibpodToContainerJSON (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.NetworkRm (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · parser.cUnescapeOne (cognitive 46) · ×1
  • 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.
D2 · Cognitive Complexity · containers.restore (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · abi.getAllQuadlets (cognitive 45) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.removePod (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.Refresh (cognitive 44) · ×1
  • SQLiteState.Refresh (cognitive 44) libpod/sqlite_state.go:129 — 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.
D2 · Cognitive Complexity · specgen.ParseNetworkFlag (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · PodSpecGenerator.Validate (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · volumes.prune (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · events.generateEventFilter (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · compat.StatsContainer (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.setNamespaces (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.requestMachinePorts (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · Container.runHealthCheck (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · Container.getContainerNetworkInfo (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerMount (cognitive 42) · ×1
  • ContainerEngine.ContainerMount (cognitive 42) pkg/domain/infra/abi/containers.go:1443 — 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.
D2 · Cognitive Complexity · ContainerEngine.SystemDf (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · generate.SpecGenToOCI (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · kube.VolumeFromHostPath (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · util.ParseDockerignore (cognitive 42) · ×1
  • util.ParseDockerignore (cognitive 42) REDACTED:55 — 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.
D2 · Cognitive Complexity · Runtime.evictContainer (cognitive 41) · ×1
  • Runtime.evictContainer (cognitive 41) libpod/runtime_ctr.go:1077 — 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.
D2 · Cognitive Complexity · Container.NetworkDisconnect (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.SystemCheck (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · kube.ToPodOpt (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · generate.executePodTemplate (cognitive 40) · ×1
  • 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.
D2 · Cognitive Complexity · containers.ps (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · main.loadTemplateInstances (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · Container.setupStorage (cognitive 39) · ×1
  • Container.setupStorage (cognitive 39) libpod/container_internal.go:448 — Container.setupStorage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (31 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.
D2 · Cognitive Complexity · generate.DevicesFromPath (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · NotifyProxy.listen (cognitive 39) · ×1
  • NotifyProxy.listen (cognitive 39) pkg/systemd/notifyproxy/notifyproxy.go:189 — 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 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.
D2 · Cognitive Complexity · libpod.attachExecHTTP (cognitive 38) · ×1
  • libpod.attachExecHTTP (cognitive 38) libpod/oci_conmon_exec_common.go:481 — 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRun (cognitive 38) · ×1
  • ContainerEngine.ContainerRun (cognitive 38) pkg/domain/infra/abi/containers.go:1206 — 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.
D2 · Cognitive Complexity · machine.initMachine (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.readConmonPipeData (cognitive 37) · ×1
  • libpod.readConmonPipeData (cognitive 37) REDACTED:1470 — libpod.readConmonPipeData has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 3, match/switch 1 (nesting depth added 22). Of this number, 34 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.
D2 · Cognitive Complexity · EventLogFile.Read (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.Mount (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRm (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · shim.Reset (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · generate.PodConfigToSpec (cognitive 37) · ×1
  • generate.PodConfigToSpec (cognitive 37) pkg/specgen/generate/pod_create.go:279 — 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.
D2 · Cognitive Complexity · connection.add (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · Container.getContainerInspectData (cognitive 36) · ×1
  • Container.getContainerInspectData (cognitive 36) libpod/container_inspect.go:65 — 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.
D2 · Cognitive Complexity · Container.mountNamedVolume (cognitive 36) · ×1
  • Container.mountNamedVolume (cognitive 36) libpod/container_internal.go:1953 — 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.
D2 · Cognitive Complexity · Runtime.Migrate (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.UpdateVolumePlugins (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · compat.convertLibpodNetworktoDockerNetwork (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.SystemPrune (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerStart (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · kube.envVarValue (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · trust.AddPolicyEntries (cognitive 36) · ×1
  • 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.
D2 · Cognitive Complexity · main.process (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · Container.execStartAndAttach (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · Container.NetworkConnect (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRestore (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · generate.MakePod (cognitive 35) · ×1
  • generate.MakePod (cognitive 35) pkg/specgen/generate/pod_create.go:23 — generate.MakePod has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 3 (nesting depth added 10). Of this number, 31 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EventJournalD.Read (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · network.networkCreate (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · main.parent (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · Container.WaitForExit (cognitive 34) · ×1
  • Container.WaitForExit (cognitive 34) libpod/container_api.go:606 — 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.
D2 · Cognitive Complexity · Pod.Inspect (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.addContainer (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · compat.UpdateContainer (cognitive 34) · ×1
  • compat.UpdateContainer (cognitive 34) pkg/api/handlers/compat/containers.go:786 — 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.
D2 · Cognitive Complexity · abi.getKubePods (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerUnmount (cognitive 34) · ×1
  • ContainerEngine.ContainerUnmount (cognitive 34) pkg/domain/infra/abi/containers.go:1552 — 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.
D2 · Cognitive Complexity · listLocal.build (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · util.breakInsert (cognitive 34) · ×1
  • util.breakInsert (cognitive 34) REDACTED:438 — 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.
D2 · Cognitive Complexity · common.DefineCreateFlags (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · generate.systemd (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · logs.getTailLog (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.migrateDB (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.AllContainers (cognitive 33) · ×1
  • SQLiteState.AllContainers (cognitive 33) libpod/sqlite_state.go:881 — 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.
D2 · Cognitive Complexity · compat.GetEvents (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · images.build (cognitive 33) · ×1
  • images.build (cognitive 33) REDACTED:1021 — 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.
D2 · Cognitive Complexity · ImageEngine.List (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRunlabel (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · ps.GetContainerLists (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · containers.copyToContainer (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · containers.create (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · images.prepareContainerFiles (cognitive 32) · ×1
  • images.prepareContainerFiles (cognitive 32) REDACTED:591 — 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerClone (cognitive 32) · ×1
  • ContainerEngine.ContainerClone (cognitive 32) pkg/domain/infra/abi/containers.go:1753 — 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.
D2 · Cognitive Complexity · ContainerEngine.PodClone (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · util.parseTriple (cognitive 32) · ×1
  • util.parseTriple (cognitive 32) REDACTED:357 — 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.
D2 · Cognitive Complexity · images.imagePush (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · images.imageSearch (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · manifest.add (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.resultToBasicNetworkConfig (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.getLockManager (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · Container.execLightweight (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · Container.prepareProcessExec (cognitive 31) · ×1
  • Container.prepareProcessExec (cognitive 31) libpod/oci_conmon_exec_common.go:669 — Container.prepareProcessExec has cognitive complexity 31 (threshold 15). Drivers by points: if/else 21 (27 pts), loops 3, boolean chains 1 (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.
D2 · Cognitive Complexity · Container.canStopServiceContainer (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · events.newEventFromJournalEntry (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · compat.ListContainers (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · filters.GenerateVolumeFilters (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRestore (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.addNetworks (cognitive 31) · ×1
  • quadlet.addNetworks (cognitive 31) pkg/systemd/quadlet/quadlet.go:1881 — 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.
D2 · Cognitive Complexity · util.getDevices (cognitive 31) · ×1
  • 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.
D2 · Cognitive Complexity · containers.exec (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · farm.farmUpdate (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · manifest.push (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · localapi.CheckIfImageBuildPathsOnRunningMachine (cognitive 30) · ×1
  • localapi.CheckIfImageBuildPathsOnRunningMachine (cognitive 30) internal/localapi/utils.go:166 — 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.
D2 · Cognitive Complexity · libpod.generateKubeSecurityContext (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Container.cleanupStorage (cognitive 30) · ×1
  • Container.cleanupStorage (cognitive 30) libpod/container_internal.go:2074 — 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.
D2 · Cognitive Complexity · Runtime.mergeDBConfig (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.NewPod (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · compat.CreateContainer (cognitive 30) · ×1
  • compat.CreateContainer (cognitive 30) pkg/api/handlers/compat/containers_create.go:59 — compat.CreateContainer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 3 (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.
D2 · Cognitive Complexity · libpod.PushImage (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · artifacts.Extract (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.ManifestAnnotate (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.containerStopImpl (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · Farm.Build (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.handleUserRemap (cognitive 30) · ×1
  • quadlet.handleUserRemap (cognitive 30) pkg/systemd/quadlet/quadlet.go:1820 — 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.
D2 · Cognitive Complexity · util.ParseIDMapping (cognitive 30) · ×1
  • util.ParseIDMapping (cognitive 30) REDACTED:961 — 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.
D2 · Cognitive Complexity · containers.copyFromContainer (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · validate.CheckAllLatestAndIDFile (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · main.loadUnitDropins (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.detectCycles (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · Container.ExecHTTPStartAndAttach (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · Container.exec (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · Container.getActiveExecSessions (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.CommitContainer (cognitive 29) · ×1
  • libpod.CommitContainer (cognitive 29) pkg/api/handlers/libpod/images.go:558 — 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.
D2 · Cognitive Complexity · updater.assembleTasks (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · util.ToParams (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · generate.GetDefaultNamespaceMode (cognitive 29) · ×1
  • 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.
D2 · Cognitive Complexity · common.AutocompleteFormat (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · ConmonOCIRuntime.StopContainer (cognitive 28) · ×1
  • ConmonOCIRuntime.StopContainer (cognitive 28) REDACTED:338 — 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.
D2 · Cognitive Complexity · Pod.stopWithTimeout (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.RemoveStorageContainer (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · compat.GetImages (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerCleanup (cognitive 28) · ×1
  • ContainerEngine.ContainerCleanup (cognitive 28) pkg/domain/infra/abi/containers.go:1370 — 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.
D2 · Cognitive Complexity · tunnel.parseBuildOutput (cognitive 28) · ×1
  • tunnel.parseBuildOutput (cognitive 28) REDACTED:551 — tunnel.parseBuildOutput has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · emulation.parseBinfmtMisc (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · Farm.Schedule (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · generate.MapSpec (cognitive 28) · ×1
  • generate.MapSpec (cognitive 28) pkg/specgen/generate/pod_create.go:178 — 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.
D2 · Cognitive Complexity · quadlet.translateUnitDependencies (cognitive 28) · ×1
  • quadlet.translateUnitDependencies (cognitive 28) pkg/systemd/quadlet/quadlet.go:2398 — quadlet.translateUnitDependencies has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · images.sortImages (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.startNode (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.ManifestPush (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · updater.updateUnit (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · infra.ParseIDMapping (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.ArtifactAdd (cognitive 27) · ×1
  • ImageEngine.ArtifactAdd (cognitive 27) REDACTED:106 — 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.
D2 · Cognitive Complexity · vsock.loadHVSockRegistryEntries (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · images.imagePull (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.httpAttachTerminalCopy (cognitive 26) · ×1
  • libpod.httpAttachTerminalCopy (cognitive 26) REDACTED:1579 — 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.
D2 · Cognitive Complexity · Event.toHumanReadable (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ConmonOCIRuntime.Attach (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.refresh (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.RenameVolume (cognitive 26) · ×1
  • SQLiteState.RenameVolume (cognitive 26) libpod/sqlite_state.go:1410 — 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.
D2 · Cognitive Complexity · Volume.mount (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · compat.inspectCandidate (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ps.ListContainerBatch (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.ConvertKube (cognitive 26) · ×1
  • quadlet.ConvertKube (cognitive 26) pkg/systemd/quadlet/quadlet.go:1264 — 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.
D2 · Cognitive Complexity · common.getImages (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · containers.pullImage (cognitive 25) · ×1
  • containers.pullImage (cognitive 25) cmd/podman/containers/create.go:358 — 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.
D2 · Cognitive Complexity · containers.portsToString (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · inspector.inspectAll (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · BoltState.getContainerFromDB (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.redirectResponseToOutputStreams (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · Container.NamespaceMode (cognitive 25) · ×1
  • Container.NamespaceMode (cognitive 25) libpod/container.go:1538 — 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.
D2 · Cognitive Complexity · Container.init (cognitive 25) · ×1
  • Container.init (cognitive 25) libpod/container_internal.go:1011 — Container.init has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Container.restartWithTimeout (cognitive 25) · ×1
  • Container.restartWithTimeout (cognitive 25) libpod/container_internal.go:1682 — Container.restartWithTimeout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Container.setupOCIHooks (cognitive 25) · ×1
  • Container.setupOCIHooks (cognitive 25) libpod/container_internal.go:2504 — Container.setupOCIHooks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compat.executeBuild (cognitive 25) · ×1
  • compat.executeBuild (cognitive 25) pkg/api/handlers/compat/images_build.go:910 — 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.
D2 · Cognitive Complexity · ImageEngine.Push (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.buildImageFromContainerfile (cognitive 25) · ×1
  • ContainerEngine.buildImageFromContainerfile (cognitive 25) pkg/domain/infra/abi/play.go:1346 — ContainerEngine.buildImageFromContainerfile has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Container.Attach (cognitive 24) · ×1
  • Container.Attach (cognitive 24) libpod/container_api.go:193 — 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.
D2 · Cognitive Complexity · Container.waitForHealthy (cognitive 24) · ×1
  • Container.waitForHealthy (cognitive 24) libpod/container_internal.go:1341 — 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 1384). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Container.waitForConmonToExitAndSave (cognitive 24) · ×1
  • Container.waitForConmonToExitAndSave (cognitive 24) libpod/container_internal.go:1537 — 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.
D2 · Cognitive Complexity · ConmonOCIRuntime.startExec (cognitive 24) · ×1
  • ConmonOCIRuntime.startExec (cognitive 24) libpod/oci_conmon_exec_common.go:329 — 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.
D2 · Cognitive Complexity · Runtime.RemoveContainersForImageCallback (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.RemovePodContainers (cognitive 24) · ×1
  • SQLiteState.RemovePodContainers (cognitive 24) libpod/sqlite_state.go:1848 — 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.
D2 · Cognitive Complexity · compat.SearchImages (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · auth.getConfigCredentials (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · containers.Commit (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · abi.splitMultiDocYAML (cognitive 24) · ×1
  • abi.splitMultiDocYAML (cognitive 24) pkg/domain/infra/abi/play.go:1719 — 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.
D2 · Cognitive Complexity · abi.stopLoadedTemplateInstances (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.remoteManifestInspect (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · tunnel.getPodsByContext (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.Build (cognitive 24) · ×1
  • ImageEngine.Build (cognitive 24) REDACTED:418 — ImageEngine.Build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageEngine.handleBuildOutputs (cognitive 24) · ×1
  • ImageEngine.handleBuildOutputs (cognitive 24) REDACTED:483 — ImageEngine.handleBuildOutputs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · generate.applyHealthCheckOverrides (cognitive 24) · ×1
  • generate.applyHealthCheckOverrides (cognitive 24) pkg/specgen/generate/container.go:67 — 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.
D2 · Cognitive Complexity · specgenutil.MakeHealthCheckFromCli (cognitive 24) · ×1
  • specgenutil.MakeHealthCheckFromCli (cognitive 24) pkg/specgenutil/specgen.go:1033 — 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.
D2 · Cognitive Complexity · containers.checkpoint (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · main.exposePorts (cognitive 23) · ×1
  • main.exposePorts (cognitive 23) cmd/rootlessport/main.go:297 — 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.
D2 · Cognitive Complexity · libpod.waitForConmonExit (cognitive 23) · ×1
  • libpod.waitForConmonExit (cognitive 23) libpod/container_api.go:685 — 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.
D2 · Cognitive Complexity · libpod.parseOptionIDs (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.getOverlayUpperAndWorkDir (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.bindPort (cognitive 23) · ×1
  • libpod.bindPort (cognitive 23) libpod/oci_util.go:116 — 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.
D2 · Cognitive Complexity · Container.ExecRemove (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Container.postDeleteHooks (cognitive 23) · ×1
  • Container.postDeleteHooks (cognitive 23) libpod/container_internal.go:2388 — Container.postDeleteHooks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 1 (3 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Container.addResolvConf (cognitive 23) · ×1
  • Container.addResolvConf (cognitive 23) REDACTED:2385 — 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.
D2 · Cognitive Complexity · Runtime.Shutdown (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · Volume.unmount (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · compat.processSecrets (cognitive 23) · ×1
  • compat.processSecrets (cognitive 23) pkg/api/handlers/compat/images_build.go:364 — 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.
D2 · Cognitive Complexity · libpod.ManifestCreate (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · images.processBuildResponse (cognitive 23) · ×1
  • images.processBuildResponse (cognitive 23) REDACTED:907 — 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRm (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · tunnel.getContainersAndInputByContext (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · define.ParseUSBs (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.handleSetWorkingDirectory (cognitive 23) · ×1
  • quadlet.handleSetWorkingDirectory (cognitive 23) pkg/systemd/quadlet/quadlet.go:2086 — 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.
D2 · Cognitive Complexity · util.getAvailableIDRanges (cognitive 23) · ×1
  • util.getAvailableIDRanges (cognitive 23) REDACTED:555 — 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.
D2 · Cognitive Complexity · util.ParseIDMap (cognitive 23) · ×1
  • util.ParseIDMap (cognitive 23) REDACTED:735 — 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.
D2 · Cognitive Complexity · EventJournalD.Write (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · common.PrepareSigning (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · farm.rm (cognitive 22) · ×1
  • farm.rm (cognitive 22) cmd/podman/farm/remove.go:47 — farm.rm has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 6). 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 49). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · libpod.podmanTopInner (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · Container.prepare (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · compat.ResizeTTY (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.InstallQuadlets (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.ManifestPush (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.playKubePVC (cognitive 22) · ×1
  • ContainerEngine.playKubePVC (cognitive 22) pkg/domain/infra/abi/play.go:1516 — 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.
D2 · Cognitive Complexity · ContainerEngine.installQuadlet (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · tunnel.startAndAttach (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerWait (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerRun (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · sparseWriter.Write (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · specgen.SetupUserNS (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · kube.VolumeFromConfigMap (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.getIOLimits (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.getImageVolume (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.getArtifactVolume (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · systemd.IsSystemdSessionValid (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · generate.PodUnits (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · util.parseAutoTriple (cognitive 22) · ×1
  • util.parseAutoTriple (cognitive 22) REDACTED:819 — 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.
D2 · Cognitive Complexity · HyperVStubber.CreateVM (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · artifact.list (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · common.AutocompleteCpCommand (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · common.getStructFields (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · containers.update (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · system.printSystemCheckResults (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · system.resetMachine (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · main.transformSwagger (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.bindPorts (cognitive 21) · ×1
  • libpod.bindPorts (cognitive 21) libpod/oci_util.go:85 — 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.
D2 · Cognitive Complexity · libpod.finalizeCtrSqlite (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Container.stopInternal (cognitive 21) · ×1
  • Container.stopInternal (cognitive 21) libpod/container_internal.go:1442 — 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.
D2 · Cognitive Complexity · events.GetNextEntry (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.RenumberLocks (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · compat.KillContainer (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · compat.ExecStartHandler (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · compat.Connect (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.KubePlay (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.PodStats (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · Connection.DoRequest (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · images.Pull (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · images.Push (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.Prune (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.KubeApply (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.GenerateSpec (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.VolumeInspect (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · emulation.registeredBinfmtMisc (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · kube.getPodPorts (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · specgenutil.CreatePortBindings (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · trust.loadAndMergeConfig (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · HyperVStubber.SetProviderAttrs (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · images.load (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · images.save (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · kube.printPlayReport (cognitive 20) · ×1
  • kube.printPlayReport (cognitive 20) cmd/podman/kube/play.go:558 — 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.
D2 · Cognitive Complexity · machine.ssh (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · system.eventsCmd (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · system.prune (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.newConmonOCIRuntime (cognitive 20) · ×1
  • libpod.newConmonOCIRuntime (cognitive 20) REDACTED:77 — 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.
D2 · Cognitive Complexity · Container.generateInspectContainerConfig (cognitive 20) · ×1
  • Container.generateInspectContainerConfig (cognitive 20) libpod/container_inspect.go:377 — 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.
D2 · Cognitive Complexity · Container.handleRestartPolicy (cognitive 20) · ×1
  • Container.handleRestartPolicy (cognitive 20) libpod/container_internal.go:272 — Container.handleRestartPolicy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (20 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Container.resetHealthCheckTimers (cognitive 20) · ×1
  • Container.resetHealthCheckTimers (cognitive 20) libpod/container_internal.go:2960 — Container.resetHealthCheckTimers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConmonOCIRuntime.sharedConmonArgs (cognitive 20) · ×1
  • ConmonOCIRuntime.sharedConmonArgs (cognitive 20) REDACTED:1338 — ConmonOCIRuntime.sharedConmonArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 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.
D2 · Cognitive Complexity · Pod.GetPodPidInformation (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.PruneVolumes (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · compat.ExecCreateHandler (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · compat.CreateVolume (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · crutils.CRCreateRootFsDiffTar (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerCheckpoint (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · shim.Remove (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · MachineConfig.Remove (cognitive 20) · ×1
  • MachineConfig.Remove (cognitive 20) pkg/machine/vmconfigs/machine.go:146 — 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 186). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · specgenutil.GetResources (cognitive 20) · ×1
  • specgenutil.GetResources (cognitive 20) pkg/specgenutil/specgen.go:1341 — 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.
D2 · Cognitive Complexity · specgenutil.parseSplitPort (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · UnitFile.Parse (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · util.GetAutoOptions (cognitive 20) · ×1
  • util.GetAutoOptions (cognitive 20) REDACTED:909 — 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.
D2 · Cognitive Complexity · containers.stop (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · farm.build (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · images.build (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · machine.inspect (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · manifest.annotate (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · connection.inspect (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · volumes.rm (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Container.refresh (cognitive 19) · ×1
  • Container.refresh (cognitive 19) libpod/container_internal.go:651 — 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.
D2 · Cognitive Complexity · Container.prepareToStart (cognitive 19) · ×1
  • Container.prepareToStart (cognitive 19) libpod/container_internal.go:805 — 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.
D2 · Cognitive Complexity · Pod.GenerateForKube (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Runtime.PruneBuildContainers (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.AddPod (cognitive 19) · ×1
  • SQLiteState.AddPod (cognitive 19) libpod/sqlite_state.go:1703 — 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.
D2 · Cognitive Complexity · SQLiteState.RemovePod (cognitive 19) · ×1
  • SQLiteState.RemovePod (cognitive 19) libpod/sqlite_state.go:1773 — 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerInspect (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.NetworkInspect (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · GvProxyNotifier.handleConnection (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ocipull.GetDiskArtifactReference (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · specgen.parseBridgeNetworkOptions (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · generate.getSeccompConfig (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · common.getPathCompletion (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · containers.removeContainers (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · containers.validateStart (cognitive 18) · ×1
  • containers.validateStart (cognitive 18) cmd/podman/containers/start.go:91 — containers.validateStart has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. 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.
D2 · Cognitive Complexity · parse.parseEnvOrLabel (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · registry.NewContainerEngine (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · secrets.inspect (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · localapi.FindMachineByPort (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.WithStorageConfig (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · Container.NetworkMode (cognitive 18) · ×1
  • Container.NetworkMode (cognitive 18) libpod/container.go:1472 — 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.
D2 · Cognitive Complexity · Container.setupStorageMapping (cognitive 18) · ×1
  • Container.setupStorageMapping (cognitive 18) libpod/container_internal.go:400 — 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.
D2 · Cognitive Complexity · storageService.CreateContainerStorage (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.Restore (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.processMultipartQuadlets (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · containers.Logs (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · manifests.Push (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.digestFromDigestOrManifestListMember (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.SecretRm (cognitive 18) · ×1
  • ContainerEngine.SecretRm (cognitive 18) pkg/domain/infra/tunnel/secrets.go:58 — 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.
D2 · Cognitive Complexity · QEMUStubber.stopLocked (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · generate.BlockAccessToKernelFilesystems (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · generate.CheckName (cognitive 18) · ×1
  • generate.CheckName (cognitive 18) pkg/specgen/generate/container.go:621 — 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.
D2 · Cognitive Complexity · kube.envVarsFrom (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.ConvertBuild (cognitive 18) · ×1
  • quadlet.ConvertBuild (cognitive 18) pkg/systemd/quadlet/quadlet.go:1447 — 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.
D2 · Cognitive Complexity · WSLStubber.SetProviderAttrs (cognitive 18) · ×1
  • WSLStubber.SetProviderAttrs (cognitive 18) pkg/machine/wsl/stubber.go:133 — WSLStubber.SetProviderAttrs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main.parseCommands (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · network.networkRm (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · registry.setXdgDirs (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Container.Update (cognitive 17) · ×1
  • Container.Update (cognitive 17) libpod/container_api.go:132 — 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.
D2 · Cognitive Complexity · Container.Unmount (cognitive 17) · ×1
  • Container.Unmount (cognitive 17) libpod/container_api.go:506 — 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.
D2 · Cognitive Complexity · Container.removeAllExecSessions (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · Container.resolveWorkDir (cognitive 17) · ×1
  • Container.resolveWorkDir (cognitive 17) REDACTED:913 — 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.
D2 · Cognitive Complexity · Container.Top (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ConmonOCIRuntime.ExecStopContainer (cognitive 17) · ×1
  • ConmonOCIRuntime.ExecStopContainer (cognitive 17) libpod/oci_conmon_exec_common.go:210 — 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.
D2 · Cognitive Complexity · Pod.maybeStopServiceContainer (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.AddVolume (cognitive 17) · ×1
  • SQLiteState.AddVolume (cognitive 17) libpod/sqlite_state.go:2047 — 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.
D2 · Cognitive Complexity · compat.ListVolumes (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.CreateContainer (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · utils.WaitContainerLibpod (cognitive 17) · ×1
  • utils.WaitContainerLibpod (cognitive 17) pkg/api/handlers/utils/containers.go:113 — utils.WaitContainerLibpod has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bindings.tcpClient (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · abi.setUpClusterClient (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · abi.parseMultiQuadletFile (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.ContainerStats (cognitive 17) · ×1
  • ContainerEngine.ContainerStats (cognitive 17) pkg/domain/infra/abi/containers.go:1650 — 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 1679, 1660). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ImageEngine.Save (cognitive 17) · ×1
  • ImageEngine.Save (cognitive 17) REDACTED:316 — 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.
D2 · Cognitive Complexity · env.parseEnv (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · machine.WaitAPIAndPrintInfo (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · DynamicIgnition.GenerateIgnitionConfig (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · generate.createPodOptions (cognitive 17) · ×1
  • generate.createPodOptions (cognitive 17) pkg/specgen/generate/pod_create.go:123 — 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.
D2 · Cognitive Complexity · kube.VolumeFromSecret (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · quadlet.ConvertNetwork (cognitive 17) · ×1
  • quadlet.ConvertNetwork (cognitive 17) pkg/systemd/quadlet/quadlet.go:1047 — 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.
D2 · Cognitive Complexity · trust.parseUids (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · util.FiltersFromRequest (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · wutil.matchOutputLine (cognitive 17) · ×1
  • wutil.matchOutputLine (cognitive 17) pkg/machine/wsl/wutil/wutil.go:166 — 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.
D2 · Cognitive Complexity · artifact.artifactPush (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · common.GetHealthCheckOverrideConfig (cognitive 16) · ×1
  • common.GetHealthCheckOverrideConfig (cognitive 16) cmd/podman/common/create.go:1093 — 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.
D2 · Cognitive Complexity · containers.copyContainerToContainer (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · kube.teardown (cognitive 16) · ×1
  • kube.teardown (cognitive 16) cmd/podman/kube/play.go:461 — 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.
D2 · Cognitive Complexity · machine.hostInfo (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · system.reset (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · main.loadUnitsFromDir (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · registry.StartWithOptions (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.parseIDMapMountOption (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.readStdio (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Container.moveToConmonCgroup (cognitive 16) · ×1
  • Container.moveToConmonCgroup (cognitive 16) libpod/conmon_cgroup_linux.go:102 — Container.moveToConmonCgroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Container.cGroupPath (cognitive 16) · ×1
  • Container.cGroupPath (cognitive 16) libpod/container.go:1182 — 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.
D2 · Cognitive Complexity · Container.syncContainer (cognitive 16) · ×1
  • Container.syncContainer (cognitive 16) libpod/container_internal.go:361 — 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.
D2 · Cognitive Complexity · Container.setupSystemd (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Container.newContainerEventWithInspectData (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · Pod.maybeRemoveServiceContainer (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · SQLiteState.RemoveVolume (cognitive 16) · ×1
  • SQLiteState.RemoveVolume (cognitive 16) libpod/sqlite_state.go:2116 — 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.
D2 · Cognitive Complexity · SQLiteState.removeContainerWithTx (cognitive 16) · ×1
  • SQLiteState.removeContainerWithTx (cognitive 16) libpod/sqlite_state_internal.go:525 — 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 528). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SQLiteState.networkModify (cognitive 16) · ×1
  • SQLiteState.networkModify (cognitive 16) libpod/sqlite_state_internal.go:574 — 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.
D2 · Cognitive Complexity · compat.StopContainer (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · libpod.PullArtifact (cognitive 16) · ×1
  • libpod.PullArtifact (cognitive 16) pkg/api/handlers/libpod/artifacts.go:79 — 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.
D2 · Cognitive Complexity · libpod.ExportImageRootfs (cognitive 16) · ×1
  • libpod.ExportImageRootfs (cognitive 16) pkg/api/handlers/libpod/images.go:258 — libpod.ExportImageRootfs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · libpod.ExportImages (cognitive 16) · ×1
  • libpod.ExportImages (cognitive 16) pkg/api/handlers/libpod/images.go:328 — 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.
D2 · Cognitive Complexity · kube.PlayWithBody (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · entities.ToPodSpecGen (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ImageEngine.ArtifactRm (cognitive 16) · ×1
  • ImageEngine.ArtifactRm (cognitive 16) pkg/domain/infra/abi/artifact.go:120 — 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.
D2 · Cognitive Complexity · ContainerEngine.PodPs (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ContainerEngine.PodInspect (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · OSTree.Upgrade (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · QEMUStubber.StartVM (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · UsernsMode.GetKeepIDOptions (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · trust.descriptionsOfPolicyRequirements (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · util.fillIDMap (cognitive 16) · ×1
  • util.fillIDMap (cognitive 16) REDACTED:641 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: types.go → register_kube.go, play.go, play.go pkg/bindings/kube/types.go — `pkg/bindings/kube/types.go` changes together with 3 other files — `pkg/api/server/register_kube.go`, `pkg/domain/entities/play.go`, `pkg/domain/infra/abi/play.go` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
D4 · Code Duplication · Near-duplicate member pair (61 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) REDACTED:323 — REDACTED:323-467 | REDACTED:473-612 — These two members are variants of one another: 54 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (43 shared lines) · ×1
  • Near-duplicate member pair (43 shared lines) pkg/domain/infra/runtime_libpod.go:220 — pkg/domain/infra/runtime_libpod.go:220-294 | REDACTED:961-1047 — 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.
D4 · Code Duplication · Near-duplicate member pair (34 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (26 shared lines) · ×1
  • Near-duplicate member pair (26 shared lines) REDACTED:357 — REDACTED:357-433 | REDACTED:819-884 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) pkg/api/handlers/compat/containers.go:755 — pkg/api/handlers/compat/containers.go:755-784 | 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.
D4 · Code Duplication · Edited copy of a member (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) pkg/specgen/generate/config_freebsd.go:20 — pkg/specgen/generate/config_freebsd.go:20-95 | pkg/specgen/generate/config_linux.go:27-97 — These two members are one piece of code written twice and then edited apart: 71 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (78 corresponding lines) · ×1
  • Edited copy of a member (78 corresponding lines) pkg/api/handlers/libpod/images.go:179 — pkg/api/handlers/libpod/images.go:179-256 | pkg/api/handlers/libpod/images.go:328-421 — These two members are one piece of code written twice and then edited apart: 78 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (98 corresponding lines) · ×1
  • Edited copy of a member (98 corresponding lines) libpod/container_internal_freebsd.go:36 — libpod/container_internal_freebsd.go:36-133 | libpod/container_internal_linux.go:61-174 — These two members are one piece of code written twice and then edited apart: 98 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) libpod/sqlite_state.go:1703 — libpod/sqlite_state.go:1703-1769 | libpod/sqlite_state.go:2047-2113 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (74 corresponding lines) · ×1
  • Edited copy of a member (74 corresponding lines) pkg/bindings/images/push.go:24 — pkg/bindings/images/push.go:24-101 | pkg/bindings/manifests/manifests.go:240-313 — These two members are one piece of code written twice and then edited apart: 74 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (52 corresponding lines) · ×1
  • Edited copy of a member (52 corresponding lines) pkg/api/handlers/compat/containers_restart.go:18 — pkg/api/handlers/compat/containers_restart.go:18-69 | pkg/api/handlers/compat/containers_stop.go:19-85 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) pkg/api/handlers/libpod/artifacts.go:185 — pkg/api/handlers/libpod/artifacts.go:185-233 | REDACTED:340-396 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (56 corresponding lines) · ×1
  • Edited copy of a member (56 corresponding lines) pkg/domain/infra/abi/manifest.go:196 — pkg/domain/infra/abi/manifest.go:196-251 | pkg/domain/infra/abi/manifest.go:344-399 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) pkg/domain/infra/tunnel/manifest.go:56 — pkg/domain/infra/tunnel/manifest.go:56-94 | pkg/domain/infra/tunnel/manifest.go:97-130 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 52+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 52+ corresponding lines) libpod/boltdb_state.go:135 — libpod/boltdb_state.go:135-186 | libpod/boltdb_state.go:437-489 | libpod/boltdb_state.go:545-598 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 52 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 37+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 37+ corresponding lines) libpod/sqlite_state.go:773 — libpod/sqlite_state.go:773-817 | libpod/sqlite_state.go:1310-1354 | libpod/sqlite_state.go:1359-1403 | libpod/sqlite_state.go:1966-2010 | libpod/sqlite_state.go:2211-2255 | libpod/sqlite_state_internal.go:366-402 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 37 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) pkg/api/handlers/libpod/pods.go:240 — pkg/api/handlers/libpod/pods.go:240-282 | pkg/api/handlers/libpod/volumes.go:179-211 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) pkg/namespaces/namespaces.go:64 — pkg/namespaces/namespaces.go:64-105 | REDACTED:909-958 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (44 corresponding lines) · ×1
  • Edited copy of a member (44 corresponding lines) libpod/pod_api.go:75 — libpod/pod_api.go:75-120 | libpod/pod_api.go:450-493 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (54 corresponding lines) · ×1
  • Edited copy of a member (54 corresponding lines) REDACTED:123 — REDACTED:123-176 | REDACTED:180-235 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) pkg/systemd/quadlet/quadlet.go:1394 — pkg/systemd/quadlet/quadlet.go:1394-1445 | pkg/systemd/quadlet/quadlet.go:2498-2540 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×1
  • Edited copy of a member (41 corresponding lines) cmd/podman/machine/info.go:53 — cmd/podman/machine/info.go:53-93 | cmd/podman/system/info.go:77-120 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 24+ corresponding lines) pkg/domain/infra/tunnel/containers.go:92 — pkg/domain/infra/tunnel/containers.go:92-115 | pkg/domain/infra/tunnel/containers.go:117-140 | pkg/domain/infra/tunnel/containers.go:189-213 | pkg/domain/infra/tunnel/containers.go:987-1013 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 27+ corresponding lines) cmd/podman/common/completion.go:144 — cmd/podman/common/completion.go:144-177 | cmd/podman/common/completion.go:291-317 | cmd/podman/common/completion.go:328-356 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) cmd/podman/registry/config.go:181 — cmd/podman/registry/config.go:181-219 | libpod/runtime.go:134-171 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) pkg/domain/infra/abi/containers.go:943 — pkg/domain/infra/abi/containers.go:943-970 | pkg/domain/infra/abi/containers.go:972-1000 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 35+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 35+ corresponding lines) cmd/podman/containers/pause.go:17 — cmd/podman/containers/pause.go:17-53 | cmd/podman/containers/stop.go:18-56 | cmd/podman/containers/unpause.go:17-51 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 35 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 29+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 29+ corresponding lines) libpod/plugin/volume_api.go:287 — libpod/plugin/volume_api.go:287-315 | libpod/plugin/volume_api.go:318-350 | libpod/plugin/volume_api.go:374-406 | libpod/plugin/volume_api.go:411-443 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 29 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) cmd/podman/artifact/list.go:195 — cmd/podman/artifact/list.go:195-225 | cmd/podman/machine/list.go:107-139 | cmd/podman/secrets/list.go:101-128 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) pkg/lookup/lookup.go:111 — pkg/lookup/lookup.go:111-137 | pkg/lookup/lookup.go:144-172 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) cmd/podman/containers/restart.go:17 — cmd/podman/containers/restart.go:17-53 | cmd/podman/containers/rm.go:21-59 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×1
  • Edited copy of a member (32 corresponding lines) REDACTED:61 — REDACTED:61-93 | REDACTED:96-127 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) cmd/podman/artifact/list.go:164 — cmd/podman/artifact/list.go:164-193 | cmd/podman/images/list.go:161-192 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 20+ corresponding lines) pkg/domain/infra/tunnel/pods.go:20 — pkg/domain/infra/tunnel/pods.go:20-45 | pkg/domain/infra/tunnel/pods.go:57-76 | pkg/domain/infra/tunnel/pods.go:78-101 | pkg/domain/infra/tunnel/pods.go:103-128 | pkg/domain/infra/tunnel/pods.go:130-149 | pkg/domain/infra/tunnel/pods.go:151-171 | pkg/domain/infra/tunnel/pods.go:173-196 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 20+ corresponding lines) pkg/domain/infra/tunnel/containers.go:324 — pkg/domain/infra/tunnel/containers.go:324-346 | REDACTED:205-225 | pkg/domain/infra/tunnel/network.go:25-47 | pkg/domain/infra/tunnel/pods.go:230-249 | pkg/domain/infra/tunnel/secrets.go:29-51 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) pkg/bindings/containers/create.go:14 — pkg/bindings/containers/create.go:14-36 | pkg/bindings/network/network.go:137-168 | pkg/bindings/network/network.go:171-197 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 16+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 16+ corresponding lines) pkg/api/handlers/libpod/artifacts.go:48 — pkg/api/handlers/libpod/artifacts.go:48-63 | pkg/api/handlers/libpod/images.go:61-76 | pkg/api/handlers/libpod/manifests.go:150-165 | REDACTED:71-87 | pkg/api/handlers/libpod/secrets.go:55-70 | pkg/api/handlers/libpod/volumes.go:214-229 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) pkg/domain/infra/abi/volumes.go:220 — pkg/domain/infra/abi/volumes.go:220-234 | pkg/domain/infra/abi/volumes.go:236-250 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 15+ corresponding lines) pkg/api/handlers/compat/containers_export.go:14 — pkg/api/handlers/compat/containers_export.go:14-32 | pkg/api/handlers/compat/containers_pause.go:13-31 | pkg/api/handlers/compat/containers_unpause.go:13-31 | pkg/api/handlers/libpod/containers.go:163-178 | pkg/api/handlers/libpod/containers.go:180-194 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) REDACTED:171 — REDACTED:171-187 | REDACTED:212-232 | REDACTED:240-263 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 17+ corresponding lines) pkg/bindings/containers/containers.go:153 — pkg/bindings/containers/containers.go:153-169 | pkg/bindings/containers/containers.go:320-336 | pkg/bindings/containers/mount.go:33-49 | pkg/bindings/images/images.go:216-235 | pkg/bindings/images/images.go:238-257 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) cmd/podman/containers/unmount.go:77 — cmd/podman/containers/unmount.go:77-92 | cmd/podman/volumes/mount.go:37-51 | cmd/podman/volumes/unmount.go:33-47 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 8+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 8+ corresponding lines) REDACTED:431 — REDACTED:431-438 | REDACTED:441-448 | REDACTED:451-458 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) pkg/bindings/artifacts/exists.go:11 — pkg/bindings/artifacts/exists.go:11-29 | pkg/bindings/images/images.go:22-34 | pkg/bindings/manifests/manifests.go:65-77 | pkg/bindings/network/network.go:200-212 | pkg/bindings/secrets/secrets.go:92-104 | pkg/bindings/volumes/volumes.go:123-135 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (8 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (8 members, 10+ corresponding lines) libpod/container.go:885 — libpod/container.go:885-894 | libpod/container.go:897-906 | libpod/container.go:912-921 | libpod/container.go:924-933 | libpod/container.go:1094-1104 | libpod/container.go:1132-1141 | libpod/container.go:1236-1245 | libpod/container.go:1248-1257 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 9+ corresponding lines) libpod/events.go:153 — libpod/events.go:153-162 | libpod/events.go:165-174 | libpod/events.go:187-195 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) cmd/podman/images/tag.go:47 — cmd/podman/images/tag.go:47-49 | cmd/podman/images/untag.go:46-48 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) REDACTED:30 — REDACTED:30-33 | pkg/domain/infra/tunnel/pods.go:15-18 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (74 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (53 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (50–51 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–22 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) REDACTED:670 — REDACTED:670-690 | libpod/oci_conmon_exec_common.go:645-665 — 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:670` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) libpod/boltdb_state_internal.go:208 — libpod/boltdb_state_internal.go:208-242 | libpod/sqlite_state_internal.go:284-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.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) libpod/oci_conmon_exec_common.go:51 — libpod/oci_conmon_exec_common.go:51-69 | libpod/oci_conmon_exec_common.go:116-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) REDACTED:476 — REDACTED:476-490 | REDACTED:1932-1949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:476` it does not close everything it opens, so those 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:1949` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (15–16 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • 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:129-144 — 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) libpod/container_api.go:60 — libpod/container_api.go:60-71 | libpod/container_internal.go:827-838 | libpod/container_internal.go:1210-1223 — 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:60` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libpod/container_internal.go:1224` calls `Debugf`, `ID` and `libpod/container_internal.go:840` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) libpod/container_api.go:55 — libpod/container_api.go:55-67 | libpod/container_internal.go:822-834 | libpod/container_internal.go:1713-1723 — 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:55` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (4–13 lines × 3) · ×1
  • Duplicated block (4–13 lines × 3) pkg/api/handlers/libpod/artifacts.go:90 — pkg/api/handlers/libpod/artifacts.go:90-93 | pkg/api/handlers/libpod/artifacts.go:247-259 | pkg/api/handlers/libpod/artifacts.go:270-282 — all 3 copies are in the same file, so extract the block into one function there and call 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • 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:167-177 | 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) pkg/api/handlers/libpod/images.go:186 — pkg/api/handlers/libpod/images.go:186-194 | pkg/api/handlers/libpod/images.go:337-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/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.
D4 · Code Duplication · Duplicated block (6–8 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • 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:827-833 | 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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (4–7 lines × 5) · ×1
  • 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:269-276 | 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.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) libpod/sqlite_state.go:685 — libpod/sqlite_state.go:685-690 | libpod/sqlite_state.go:901-906 | libpod/sqlite_state.go:931-936 | libpod/sqlite_state.go:1678-1683 — 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:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) libpod/sqlite_state.go:2276 — libpod/sqlite_state.go:2276-2281 | libpod/sqlite_state.go:2319-2324 | libpod/sqlite_state.go:2372-2377 — all 3 copies are in the same file, so extract the block into one function there and call 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:2276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 10) · ×1
  • 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:190-195 | pkg/api/handlers/libpod/images.go:830-835 | 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.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) cmd/podman/artifact/exists.go:28 — cmd/podman/artifact/exists.go:28-37 | 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 6 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 6 times.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 6) · ×1
  • 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:430-435 | pkg/api/handlers/libpod/containers.go:39-46 | pkg/api/handlers/libpod/containers.go:323-329 | pkg/api/handlers/libpod/images.go:764-769 | 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.
D4 · Code Duplication · Duplicated block (7 lines × 7) · ×1
  • Duplicated block (7 lines × 7) libpod/sqlite_state.go:787 — libpod/sqlite_state.go:787-793 | libpod/sqlite_state.go:1267-1273 | libpod/sqlite_state.go:1324-1330 | libpod/sqlite_state.go:1782-1788 | libpod/sqlite_state.go:1857-1863 | libpod/sqlite_state.go:1980-1986 | 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:787` it does not close everything it opens, so those exact 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.
Minor — 125 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×39
  • 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/api/handlers/libpod/images_push.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.
  • + 14 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×31
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 6 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×31
  • Duplicated predicate REDACTED:482 — `!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:1183 — `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:1109 — `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:1459 — `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:1886 — `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:3054 — `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:1890 — `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:623 — `errors.Is(err, define.ErrNoSuchCtr) || errors.Is(err, define.ErrCtrRemoved)` appears character-identically in 9 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:594 — `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.
  • + 6 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on error · ×5
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
DM2 · Strongly-typed ids · Primitive id on a domain type · ×2
  • 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.
  • Primitive id on a domain type: SecretRmReport.ID pkg/domain/entities/types/secrets.go:37 — `SecretRmReport.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.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 2 significant file(s) lose their only recent owner: pkg/machine/gvproxy_notify.go, pkg/api/handlers/compat/version.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 (10 single-owned of 498 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 498 of the 979 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/utils/scp_compression.go, pkg/domain/infra/abi/trust.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)` (158458 LoC, 1035 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
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 39 of 498 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 498 of the 979 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 31 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
DM5 · Encapsulated state · Mutable entity · ×1
  • Mutable entity: PruneReport pkg/domain/entities/reports/prune.go:9 — `PruneReport` exposes publicly writable state (Id, Err, Size).
P4 · Deployment & Rollback · No release approval gate · ×1
  • 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.
Minor — 4 finding(s)
D12 · Dependency Hygiene · Outdated · ×4
  • 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.
  • Outdated: go.podman.io/buildah — `go.podman.io/buildah` is required at v1.46.1-0.20261105161110-1e24bfdd3f14 in REDACTED, but v1.46.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.podman.io/buildah@v1.46.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.podman.io/image/v5 — `go.podman.io/image/v5` is required at v5.42.1-0.20261105174844-179286b8f253 in REDACTED, but v5.42.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.podman.io/image/v5@v5.42.1 && go mod tidy` and commit the updated REDACTED and go.sum.
  • Outdated: go.podman.io/storage — `go.podman.io/storage` is required at v1.65.1-0.20261105174844-179286b8f253 in REDACTED, but v1.65.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.podman.io/storage@v1.65.1 && 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.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-6c2e867f565e49899aa1c3a7549cb495/history.json --exit-code 0 --source .33artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-6c2e867f565e49899aa1c3a7549cb495/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude pkg/bindings/pods --exclude test/tools/vendor/golang.org/x/net/idna --exclude vendor/github.com/cloudflare/circl/kem/mlkem --exclude vendor/github.com/digitalocean/go-libvirt/internal/constants --exclude vendor/github.com/moby/moby/api/types/storage --exclude vendor/github.com/sigstore/protobuf-specs/gen --exclude vendor/go.opentelemetry.io/otel/semconv/v1.43.0/httpconv --exclude vendor/golang.org/x/net/idna --exclude vendor/google.golang.org/genproto/googleapis/api/annotations --exclude vendor/google.golang.org/genproto/googleapis/rpc/status --exclude vendor/google.golang.org/grpc/binarylog --exclude vendor/google.golang.org/grpc/reflection/grpc_reflection_v1 --exclude vendor/google.golang.org/grpc/reflection/grpc_reflection_v1alpha --exclude vendor/google.golang.org/protobuf/types .75artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-d1ffd6c1e66843b6a6ac4e4d1bd5c2a31artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .5artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—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.0—
D41 · Kernel & Syscall Confinementruntime-hardening—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.0—
D42 · Runtime Threat Enforcementruntime-hardening—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.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm . /tmp/codehealth-osv-sbom-d1ffd6c1e66843b6a6ac4e4d1bd5c2a30artifacts/raw/osv-scanner.json

Run 01a1d508-19df-741d-b260-574130c620ce · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

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