Public report — podman, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 07:37 UTC Public
Code Health Audit

Podman-Container-Tools/podman

No baseline yet — first run
62% Adequate
CriticalWeakAdequateStrongExemplary
middle

Large · 169,581 LoC · rebuild ~2.3 person-years · weakest lens: Code Health (45%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

24/27dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
1028findings with an exact file:lineof 1038 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
27/95dimensions across the health lenses169581 LoC — wide & deep

Executive summary

Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.

podman-container-tools/podman is sound in substance but carries real gaps (62%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.

It is strongest in Architecture (100%) — the structure is clean and changes stay contained. Readiness (97%) is solid too.

The area that most needs attention is Code Health (45%) — changes there are slower and more error-prone. Security (65%) is the next concern — exposure to security and compliance incidents is elevated.

Leadership focus, highest impact first: Secrets (history) — currently 3.0/10 (Secrets (history)); 38 Low finding(s) (Static Analysis (SAST)); 'Testing' section to the root README (Documentation (README)).

For scale: Large (~169,581 production lines); rebuilding it from scratch would take roughly ~2.3 person-years (~1–5 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Code Health 45% · 47% weightSecurity 65% · 26% weightMaturity 81% · 14% weightReadiness 97% · 8% weightArchitecture 100% · 4% weight

Raise Code Health 45 → 70 (the Healthy floor) ⇒ headline 62 → ~73.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €110,000–€550,000
Cost to rebuild€110,000–€550,000 (1.1–3.5 person-years (1,839–5,835 h), ~1–5 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 62% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~2.3 person-years of build effort (about ~€330,000 to rebuild). Its weakest lens is Code Health at 45% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.2) — CQRS × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Improve Secrets (history) — currently 3.0/10.
+3.0 pts · Medium effort · Secrets (history)
2
Resolve the 38 Low finding(s) in Static Analysis (SAST) — start with hutil.go (10), util_windows.go (6), main.go (5).
+2.7 pts · Medium effort · Static Analysis (SAST)
3
Add a 'Testing' section to the root README — how to run the test suite.
+2.5 pts · Medium effort · Documentation (README)

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~2.3 person-years to rebuild), and its weakest lens is Code Health at 45%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~2.3 person-years rebuild (169,581 LoC) · weakest lens: Code Health 45%
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 133–797.9 engineer-days every year, paid as drag on the ~606,354 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 9–20% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 149,512 line(s) changed over a 90-day window ⇒ ~606,354/year · D1/D2/D4 code quality: averaging 4.5/10 ⇒ a 9–20% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Improve Secrets (history) — currently 3.0/10. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Improve Secrets (history) — currently 3.0/10.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.5/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 9–20% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 4.5/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

187 modules, 397 dependencies — 1 dependency cycle, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

…ernal/domain/entities…dman/v6/libpod/events…podman/v6/libpod/lock…podman/v6/pkg/channel…main/entities/reports…odman/v6/pkg/logiface…v6/pkg/machine/define…dman/v6/pkg/pidhandle…g/machine/compression…/pkg/machine/ignition…podman/v6/pkg/specgen…g/systemd/notifyproxy…pkg/machine/vmconfigs…podman/v6/pkg/machine…man/v6/pkg/machine/os…n/v6/pkg/machine/qemu…domain/entities/types…n/v6/cmd/podman/utils…6/pkg/bindings/images…6/pkg/domain/entities…v6/cmd/podman/machine…an/v6/cmd/podman/pods…n.io/podman/v6/libpod…dman/v6/libpod/define…cmd/podman/containers…/v6/cmd/podman/system…/podman/v6/cmd/podman…/v6/cmd/podman/common…6/cmd/podman/networks…n/v6/pkg/api/handlers…g/api/handlers/libpod…/api/handlers/swagger…man/v6/pkg/api/server…/pkg/domain/infra/abi…6/pkg/machine/ocipull…6/cmd/podman/artifact…/v6/cmd/podman/images…g/api/handlers/compat…g/bindings/containers…g/domain/infra/tunnel…ernal/domain/entities1…dman/v6/libpod/events2…podman/v6/libpod/lock3…podman/v6/pkg/channel4…main/entities/reports5…odman/v6/pkg/logiface6…v6/pkg/machine/define7…dman/v6/pkg/pidhandle8…g/machine/compression9…/pkg/machine/ignition10…podman/v6/pkg/specgen11…g/systemd/notifyproxy12…pkg/machine/vmconfigs13…podman/v6/pkg/machine14…man/v6/pkg/machine/os15…n/v6/pkg/machine/qemu16…domain/entities/types17…n/v6/cmd/podman/utils18…6/pkg/bindings/images19…6/pkg/domain/entities20…v6/cmd/podman/machine21…an/v6/cmd/podman/pods22…n.io/podman/v6/libpod23…dman/v6/libpod/define24…cmd/podman/containers25…/v6/cmd/podman/system26…/podman/v6/cmd/podman27…/v6/cmd/podman/common28…6/cmd/podman/networks29…n/v6/pkg/api/handlers30…g/api/handlers/libpod31…/api/handlers/swagger32…man/v6/pkg/api/server33…/pkg/domain/infra/abi34…6/pkg/machine/ocipull35…6/cmd/podman/artifact36…/v6/cmd/podman/images37…g/api/handlers/compat38…g/bindings/containers39…g/domain/infra/tunnel40122112211116272366126166122661261218624122913213112511218035421622112412134144855484396516112111211212341327439211121211211216341121112112111034112111211211103424244824242448242448244872961121111211211234661263661266126341418624112111211211244112131123112173147143411211612112123413131521134211121211211121923441417413431+147 more modules (most-connected shown)

At a glance — Code Health · 45% · Weak · gated by D1, D2

At a glance — Architecture · 100% · Exemplary

At a glance — Maturity · 81% · Strong

At a glance — Readiness · 97% · Exemplary

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

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
A03:2021 — Injection48High / Critical
A05:2021 — Security Misconfiguration5High / Critical
A06:2021 — Vulnerable & Outdated Components2Medium

Roadmap

Immediately rotate all historically committed secrets to mitigate high-risk credential exposure. Next, address the 38 low-severity static analysis findings, prioritizing hutil.go, util_windows.go, and main.go. Add a testing section to the root README to clarify how to run the test suite. Expand the architecture decision record (ADR) log to eight entries and improve the quality of existing ADRs, starting with podman6hld.md.

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

Do thisHelpsEffortDimension
Improve Secrets (history) — currently 3.0/10.+3.0 ptsMediumSecrets (history)
Resolve the 38 Low finding(s) in Static Analysis (SAST) — start with hutil.go (10), util_windows.go (6), main.go (5).+2.7 ptsMediumStatic Analysis (SAST)
Add a 'Testing' section to the root README — how to run the test suite.+2.5 ptsMediumDocumentation (README)
Grow the ADR log (currently 5) — reach 8 to raise the maturity tier; document significant decisions as they're made.+2.5 ptsMediumArchitecture documentation
Resolve the 1 The body is a list of numbered sections (Branching/Schedules/Podman 5,… finding(s) in ADR Quality — start with podman6hld.md.+1.1 ptsLowADR Quality
Resolve the 4 High finding(s) in Static Analysis (SAST) — start with lima.yml, stubber.go, rootless_linux.c.+0.9 ptsLowStatic Analysis (SAST)
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with Containerfile (2).+0.9 ptsLowIaC & Container Security
Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing.+0.7 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
contrib/hello/Containerfile4.4MixedIaC & Container Security: High IaC: DS-0025
libpod/kube.go4.9MixedStatic Analysis (SAST): Medium: math-random-used
pkg/machine/qemu/stubber.go5.0MixedStatic Analysis (SAST): High: dangerous-exec-cmd
contrib/validatepr/Containerfile5.1MixedIaC & Container Security: High IaC: DS-0002
pkg/rootless/rootless_linux.go6.2MixedStatic Analysis (SAST): High: dangerous-exec-cmd
pkg/bindings/containers/attach.go6.4MixedCyclomatic Complexity: containers.Attach (cyclomatic 51)
pkg/bindings/connection.go6.4MixedCyclomatic Complexity: bindings.sshClient (cyclomatic 25)
pkg/domain/infra/abi/apply.go6.7MixedCyclomatic Complexity: ContainerEngine.KubeApply (cyclomatic 16)
go.mod6.9MixedOSV Dependency Vulnerabilities: Medium vulnerability: GO-2026-5932
pkg/specgenutil/specgen.go7.0MixedCyclomatic Complexity: specgenutil.FillOutSpecGen (cyclomatic 194)
libpod/container_internal_common.go7.0MixedCyclomatic Complexity: Container.generateSpec (cyclomatic 142)
pkg/domain/infra/abi/play.go7.0MixedCyclomatic Complexity: ContainerEngine.playKubePod (cyclomatic 129)
pkg/bindings/images/build.go7.0MixedCyclomatic Complexity: images.prepareParams (cyclomatic 114)
libpod/runtime.go7.0MixedCyclomatic Complexity: libpod.makeRuntime (cyclomatic 67)
pkg/systemd/quadlet/quadlet.go7.0MixedCyclomatic Complexity: quadlet.ConvertContainer (cyclomatic 63)
libpod/oci_conmon_common.go7.0MixedCyclomatic Complexity: ConmonOCIRuntime.createOCIContainer (cyclomatic 56)
libpod/container_internal.go7.0MixedCyclomatic Complexity: Container.mountStorage (cyclomatic 51)
pkg/api/handlers/compat/containers.go7.0MixedCyclomatic Complexity: compat.LibpodToContainerJSON (cyclomatic 38)
pkg/domain/infra/abi/containers.go7.0MixedCyclomatic Complexity: ContainerEngine.ContainerRun (cyclomatic 35)
libpod/container_api.go7.0MixedCyclomatic Complexity: Container.WaitForConditionWithInterval (cyclomatic 34)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 24 of 27 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.6 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 27 dimensions across the health lenses
D1D2D4D7D13D15D16D19D20D21D28D29D31D34D35D36D37D38AX5M1M2M3M4P1P3P4P6

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, 1028 of 1038 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ 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
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd601-587d-79de-a4a5-8f06aebf6c32.

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.

  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — 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.
  • 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.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • 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.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • 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").
  • 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.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D20, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

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: DocumentedVerifiedPrevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

304 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was specgenutil.FillOutSpecGen at 194. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being events.StringToStatus at 42 — they are counted neither in the figure above nor in this dimension's score.

ContainerEngine.ContainerStart (cyclomatic 17) · ×2pkg/domain/infra/abi/containers.go:1037
specgenutil.FillOutSpecGen (cyclomatic 194)pkg/specgenutil/specgen.go:324
Container.generateSpec (cyclomatic 142)libpod/container_internal_common.go:235
ContainerEngine.playKubePod (cyclomatic 129)pkg/domain/infra/abi/play.go:621
images.prepareParams (cyclomatic 114)pkg/bindings/images/build.go:135

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

What to do

  1. Resolve the 2 ContainerEngine.ContainerStart (cyclomatic 17) finding(s) in Cyclomatic Complexity — start with containers.go (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 specgenutil.FillOutSpecGen (cyclomatic 194) finding(s) in Cyclomatic Complexity — start with specgen.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Container.generateSpec (cyclomatic 142) finding(s) in Cyclomatic Complexity — start with container_internal_common.go. — One of this dimension's main actionable groups (1 warning-level).

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: DocumentedVerifiedPrevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

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

Container.generateSpec (cognitive 288)libpod/container_internal_common.go:235
ContainerEngine.playKubePod (cognitive 231)pkg/domain/infra/abi/play.go:621
specgenutil.FillOutSpecGen (cognitive 231)pkg/specgenutil/specgen.go:324
Runtime.setupContainer (cognitive 208)libpod/runtime_ctr.go:245
Container.restore (cognitive 188)libpod/container_internal_common.go:1557

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

What to do

  1. Resolve the 1 Container.generateSpec (cognitive 288) finding(s) in Cognitive Complexity — start with container_internal_common.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 ContainerEngine.playKubePod (cognitive 231) finding(s) in Cognitive Complexity — start with play.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 specgenutil.FillOutSpecGen (cognitive 231) finding(s) in Cognitive Complexity — start with specgen.go. — One of this dimension's main actionable groups (1 warning-level).

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

D4 · Code Duplication9.5 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.5 / 10 · rule-coverage 100% · ceiling Verified

181 duplicated block group(s) detected.

Duplicated block (9 lines × 2) · ×30cmd/podman/artifact/pull.go:63
Duplicated block (10 lines × 2) · ×29cmd/podman/artifact/push.go:55
Duplicated block (11 lines × 2) · ×17cmd/podman/artifact/list.go:155
Duplicated block (8 lines × 2) · ×16cmd/podman/artifact/push.go:80
Duplicated block (12 lines × 2) · ×13cmd/podman/containers/mount.go:108

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

✓ On the Gold path — maintain.

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Of 2 mechanizable ADRs, 1 are prevented by analyzers, 1 by tests, 0 exist only in prose. Coverage: 100 %. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

D13 · Secret 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: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: libpod/container_internal_common.go (5×142=710); pkg/bindings/images/build.go (5×114=570); pkg/specgen/generate/kube/kube.go (5×102=510)

Hotspot: libpod/container_internal_common.go · ×10libpod/container_internal_common.go

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.9 / 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: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

3 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is libpod/lock/in_memory_locks.go.

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.

D19 · Documentation Quality / 10Exemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

The podman project is well documented across READMEs, architecture/Docs markdown files, and XML-doc coverage. The README gives a clear overview of Podman's purpose, release cadence, license, and links to LFX health scores; the test/README covers destructive system tests with a detailed Quick Reference table, running-specific-test commands, and a complete test-utils section plus upgrade-testing documentation. A dedicated docs/README explains how to build the docs from source (directory structure, support files, manpage syntax, API reference), while completions/README documents shell completion scripts. The Podman Golang bindings README is especially thorough: it starts with a dependency copy policy note, walks through systemd and manual service startup, shows connection creation code, and lists every supported Podman operation plus inspect/pull/start examples. The documentation is comprehensive across READMEs, architecture/design docs, and a dedicated dependency-analysis script. It includes a clear performance-scripts tutorial with environment-variable guidance, a full systemd service setup guide for both rootless and system-wide configurations, a detailed build-and-install guide for the pkginstaller, a design-documents directory explaining its purpose and process, and an in-depth dependencies.sh analysis covering requirements, basic usage, dependency-why queries, bloat-checking diffing, and debloating. The README for the main podman CLI is exemplary — it shows how to add new commands/subcommands with code examples plus links to contributing docs. There are no clipped sections; every named design document exists.

The compose test directory mentions docker-compose v1 is no longer supported but does not state which versions of podman are tested against or how to verify compatibility with the new version.test/compose/README.md

✓ On the Gold path — maintain.

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

D20 · ADR Quality / 10Strong◐ Sampled · advisory

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: DocumentedVerifiedPrevented · effective Strong / 10 · rule-coverage 100% · ceiling Documented

Evaluated 4 ADR(s) individually; mean quality 7.8/10 (mixed — many ADRs miss context or consequences). 1 flagged with a specific gap.

The body is a list of numbered sections (Branching/Schedules/Podman 5, Deprecations, Configuration files, Changes in Defaults for Podman, Libkrun, New Conmon, Pasta, Machine, Netavark, Podman machine updates, Issues in containers/podman with "6.0" label) plus a short branching/scheduling section and then the clip marker; only the title and the first few sections are visible before clipping, so context/problem, explicit decision, consequences/trade-offs, and an informative title are not all presentcontrib/design-docs/podman6hld.md

What to do

  1. Resolve the 1 The body is a list of numbered sections (Branching/Schedules/Podman 5,… finding(s) in ADR Quality — start with podman6hld.md. — One of this dimension's main actionable groups (1 warning-level).

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

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)3.0 / 10Weak✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 3.0 / 10 · rule-coverage 100% · ceiling Documented

7 finding(s): 0 critical, 7 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

What to do

  1. Improve Secrets (history) — currently 3.0/10. — 7 finding(s): 0 critical, 7 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)2.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: DocumentedVerifiedPrevented · effective 2.2 / 10 · rule-coverage 100% · ceiling Documented

48 finding(s): 0 critical, 4 high, 6 medium, 38 low.

High: run-shell-injection · ×4.github/workflows/lima.yml:70detected by semgrep finding
Medium: math-random-used · ×6libpod/healthcheck_linux.go:9detected by semgrep finding
Low: use-of-unsafe-block · ×38cmd/podman-wslkerninst/main.go:77detected by semgrep finding

What to do

  1. Resolve the 38 Low finding(s) in Static Analysis (SAST) — start with hutil.go (10), util_windows.go (6), main.go (5). — One of this dimension's main actionable groups (38 recommendation-level).
  2. Resolve the 4 High finding(s) in Static Analysis (SAST) — start with lima.yml, stubber.go, rootless_linux.c. — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 6 Medium finding(s) in Static Analysis (SAST) — start with healthcheck_linux.go, kube.go, names-generator.go. — One of this dimension's main actionable groups (6 warning-level).

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

D31 · IaC & Container Security9.1 / 10Exemplary✓ 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: DocumentedVerifiedPrevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Documented

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

High IaC: DS-0025 · ×2contrib/hello/Containerfiledetected by trivy finding
Medium IaC: DS-0001 · ×2contrib/hello/Containerfiledetected by trivy finding
Low IaC: DS-0005contrib/hello/Containerfiledetected by trivy finding

✓ On the Gold path — maintain.

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

D34 · Knowledge Freshness8.9 / 10Strong✓ 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: DocumentedVerifiedPrevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

53 of 492 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is libpod/pod.go.

Further orphaned files (smaller)

What to do

  1. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Exemplary✓ 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; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: config.go↔machine.go 82%; config.go↔machine.go 79%; vfkit.go↔helper.go 50%

Change coupling: config.go ↔ machine.go · ×3pkg/machine/applehv/config.go

✓ On the Gold path — maintain.

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: DocumentedVerifiedPrevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

Secret passed as a command-line argument
No build provenance
No SBOM

What to do

  1. Resolve the 1 Secret passed as a command-line argument finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).

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

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: DocumentedVerifiedPrevented · 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.

D38 · OSV Dependency Vulnerabilities9.6 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.

Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.

Maturity: DocumentedVerifiedPrevented · effective 9.6 / 10 · rule-coverage 100% · ceiling Documented

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

Medium vulnerability: GO-2026-5932go.moddetected by osv-scanner finding
Medium CVE: GO-2026-4918go.moddetected by osv-scanner finding

✓ On the Gold path — maintain.

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

Frontend & cross-cutting dimensions

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

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.

M1 · Documentation (README)6.7 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation7.0 / 10Strong✓ 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.

What to do

  • Grow the ADR log (currently 5) — reach 8 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

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.

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 & Rollback10.0 / 10Exemplary✓ 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.

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.

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 Health45%Weak — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100%ExemplaryStrongest area.
Maturity81%StrongSolid.
Readiness97%ExemplarySolid.
Security65%Adequate — gated by D28, D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 68 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC2 Forms & labels — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC3 Page structure — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC4 Keyboard semantics — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC5 ARIA correctness — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC6 Visual & motion safety — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AC7 A11y enforcement — Frontend below the scale floor (8 DOM element(s) < 25) — too little surface to assess accessibility.
  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set 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
  • AX2 Stateful singletons — no singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • 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 — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
  • 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.
  • 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.
  • 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.
  • D10 Test Quality — ~80377 lines of test source are present (.go, .py) but the test-quality collector reads C# only, 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
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Go module (go.mod/go.sum) and a Python pyproject.toml/requirements.txt (pip/uv/Poetry)), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .py, .rb) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — none of 4 ADRs are conformance-checkable — unverifiable.
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D3 God Classes — Most of this repository's production source (.go) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Go module (go.mod/go.sum) and a Python pyproject.toml/requirements.txt (pip/uv/Poetry) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • D33 JS/npm Dependency Vulnerabilities — No JS/npm manifest or lockfile found outside build output (package.json, package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb); no JS dependencies to scan.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .go, .py, .rb, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.go, .py) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Domain Modelling — applicable but not scored (2 of 2 signals for this style — below the bar we score at): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); a Domain/Aggregates/ValueObjects layer
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 CQRS handler(s); 1 event-sourced shape(s) (event folds / event-recording aggregates)
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this check looks for (1 Go aggregate(s) recording domain events (own events-slice append / raise-record))
  • GD1 Unfinished & placeholder code — no source files
  • 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, 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'.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, 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
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from 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
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • 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 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
  • X2 Cancellation propagation — 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
  • X3 Exception handling — 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
  • X4 Structured logging — 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
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository

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.

Issue — 6 finding(s)
D29 · Static Analysis (SAST) · High · ×4
  • High: run-shell-injection .github/workflows/lima.yml:70 — Using variable interpolation `${{...}}` with a workflow input in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. A workflow input is not bounded by this step and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
  • High: dangerous-exec-cmd pkg/machine/qemu/stubber.go:210 — Detected non-static command inside exec.Cmd. Audit the input to 'exec.Cmd'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
  • High: insecure-use-string-copy-fn pkg/rootless/rootless_linux.c:448 — Finding triggers whenever there is a strcpy or strncpy used. This is an issue because strcpy does not affirm the size of the destination array and strncpy will not automatically NULL-terminate strings. This can lead to buffer overflows, which can cause program crashes and potentially let an attacker inject code in the program. Fix this by bounding the copy to the destination's size and terminating it yourself — `snprintf(dst, sizeof dst, "%s", src)`, or `strncpy` followed by an explicit `dst[sizeof dst - 1] = '\0'` — since the bounds-checked `_s` variants are C11 Annex K, an optional annex that glibc and musl do not implement; where your toolchain does provide them (MSVC) or provides `strlcpy` (BSD, and glibc from 2.38), either is the shorter spelling of the same fix. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
  • High: dangerous-exec-cmd pkg/rootless/rootless_linux.go:124 — Detected non-static command inside exec.Cmd. Audit the input to 'exec.Cmd'. If unverified user data can reach this call site, this is a code injection vulnerability. A malicious actor can inject a malicious script to execute arbitrary code. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
D31 · IaC & Container Security · High IaC · ×2
  • High IaC: DS-0025 contrib/hello/Containerfile — 'apk add' is missing '--no-cache' The install step leaves the package manager's index and downloaded packages behind in that layer, so every pull carries them and every CVE in them is attributed to your image. The step: this file installs with `apk`, so end the SAME `RUN` that installs with `&& apk cache clean` — a later `RUN` cannot help, because the cache is already committed to the earlier layer. (The rule's title names the command for a different package manager; the defect it measures is the same one.) Where the builder supports it, `RUN --mount=type=cache` is the alternative: the cache is mounted for the step and never enters a layer at all.
  • High IaC: DS-0002 contrib/validatepr/Containerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN useradd -r -M app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
Warning — 983 finding(s)
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×30
  • Duplicated block (9 lines × 2) cmd/podman/artifact/pull.go:63 — cmd/podman/artifact/pull.go:63-71 | cmd/podman/images/pull.go:117-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) cmd/podman/common/completion.go:299 — cmd/podman/common/completion.go:299-307 | cmd/podman/common/completion.go:337-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:299` it does not close everything it opens, so those exact lines 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/artifacts.go:236 — pkg/api/handlers/libpod/artifacts.go:236-244 | pkg/api/handlers/libpod/artifacts.go:259-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/artifacts.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/api/handlers/libpod/containers.go:473 — pkg/api/handlers/libpod/containers.go:473-481 | pkg/api/handlers/compat/containers.go:744-752 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/containers.go:473` it begins part-way through the construct above it, so those exact lines cannot be 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/domain/filters/containers.go:54 — pkg/domain/filters/containers.go:54-62 | pkg/domain/filters/containers.go:477-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:54` it begins part-way through the construct above it, so those exact lines 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/abi/containers.go:204 — pkg/domain/infra/abi/containers.go:204-212 | pkg/domain/infra/abi/containers.go:225-234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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: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.
  • Duplicated block (9 lines × 2) pkg/domain/infra/abi/containers.go:1484 — pkg/domain/infra/abi/containers.go:1484-1493 | pkg/domain/infra/abi/containers.go:1591-1599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1484` it begins part-way through the construct above it, so those exact lines 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/runtime_libpod.go:285 — pkg/domain/infra/runtime_libpod.go:285-293 | pkg/util/utils.go:1035-1043 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/machine/os/machine_os.go:34 — pkg/machine/os/machine_os.go:34-42 | pkg/machine/os/machine_os.go:62-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:34` it begins part-way through the construct above it, so those exact lines cannot be 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/specgen/namespaces.go:506 — pkg/specgen/namespaces.go:506-514 | pkg/specgen/namespaces.go:519-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:506` it does not close everything it opens, so those exact lines 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/util/utils.go:379 — pkg/util/utils.go:379-387 | pkg/util/utils.go:832-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/util/utils.go:379` it does not close everything it opens, so those exact lines 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/containers/cp.go:169 — cmd/podman/containers/cp.go:169-177 | cmd/podman/containers/cp.go:324-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) cmd/podman/farm/list.go:65 — cmd/podman/farm/list.go:65-73 | cmd/podman/system/connection/list.go:110-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) cmd/podman/images/import.go:117 — cmd/podman/images/import.go:117-125 | cmd/podman/images/load.go:95-103 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/images/import.go:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (9 lines × 2) 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:915 — libpod/container_internal.go:915-923 | libpod/pod_api.go:107-115 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_internal.go:915` it does not close everything it opens, so those exact lines 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_restart.go:29 — pkg/api/handlers/compat/containers_restart.go:29-38 | pkg/api/handlers/compat/containers_stop.go:30-38 — 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 4 separate duplicated blocks between them, totalling at least 46 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 begins part-way through the construct above it, so those exact lines 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/images.go:541 — pkg/api/handlers/compat/images.go:541-549 | pkg/api/handlers/libpod/images.go:366-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:541` it begins part-way through the construct above it, so those exact lines 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/images_history.go:17 — pkg/api/handlers/compat/images_history.go:17-25 | pkg/api/handlers/compat/images_tag.go:19-27 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/api/handlers/libpod/images.go:205 — pkg/api/handlers/libpod/images.go:205-213 | pkg/api/handlers/libpod/images.go:292-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:205` it begins part-way through the construct above it, so those exact lines 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/networks.go:151 — pkg/api/handlers/libpod/networks.go:151-159 | pkg/api/handlers/libpod/networks.go:207-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/api/handlers/libpod/pods.go:145 — pkg/api/handlers/libpod/pods.go:145-154 | pkg/api/handlers/libpod/pods.go:254-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/bindings/images/images.go:220 — pkg/bindings/images/images.go:220-228 | pkg/bindings/images/images.go:242-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) pkg/domain/infra/abi/pods.go:334 — pkg/domain/infra/abi/pods.go:334-342 | pkg/specgen/generate/pod_create.go:298-307 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/domain/infra/tunnel/containers.go:47 — pkg/domain/infra/tunnel/containers.go:47-55 | pkg/domain/infra/tunnel/containers.go:77-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • + 5 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×29
  • Duplicated block (10 lines × 2) cmd/podman/artifact/push.go:55 — cmd/podman/artifact/push.go:55-64 | cmd/podman/images/push.go:80-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) cmd/podman/common/completion.go:106 — cmd/podman/common/completion.go:106-115 | cmd/podman/common/completion.go:386-396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:106` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) cmd/podman/common/completion.go:158 — cmd/podman/common/completion.go:158-167 | cmd/podman/common/completion.go:337-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:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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) libpod/container_api.go:627 — libpod/container_api.go:627-636 | libpod/container_api.go:674-683 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:627` it begins part-way through the construct above it, so those exact lines cannot be 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) libpod/kube.go:622 — libpod/kube.go:622-631 | libpod/kube.go:768-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/kube.go:622` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) libpod/runtime_ctr.go:397 — libpod/runtime_ctr.go:397-406 | libpod/runtime_ctr.go:422-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:397` it does not close everything it opens, so those exact lines cannot be 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) libpod/sqlite_state.go:2277 — libpod/sqlite_state.go:2277-2286 | libpod/sqlite_state.go:2330-2339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:2277` it begins part-way through the construct above it, so those exact lines cannot be 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/api/handlers/libpod/containers.go:130 — pkg/api/handlers/libpod/containers.go:130-139 | pkg/api/handlers/compat/containers.go:194-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/containers.go:130` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) pkg/api/handlers/libpod/containers.go:277 — pkg/api/handlers/libpod/containers.go:277-286 | pkg/api/handlers/libpod/containers.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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/containers.go:277` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/domain/filters/containers.go:128 — pkg/domain/filters/containers.go:128-137 | pkg/domain/filters/containers.go:142-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) pkg/domain/utils/scp.go:108 — pkg/domain/utils/scp.go:108-117 | pkg/domain/utils/scp.go:157-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/utils/scp.go:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/machine/provider/platform.go:13 — pkg/machine/provider/platform.go:13-23 | pkg/machine/shim/host.go:399-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. 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) pkg/util/utils.go:408 — pkg/util/utils.go:408-417 | pkg/util/utils.go:859-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 `pkg/util/utils.go:408` it begins part-way through the construct above it, so those exact lines 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/rm.go:115 — cmd/podman/containers/rm.go:115-124 | cmd/podman/containers/stop.go:120-129 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/rm.go:115` it begins part-way through the construct above it, so those exact lines 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_common.go:359 — libpod/container_internal_common.go:359-368 | libpod/container_internal_common.go:494-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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_common.go:359` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) libpod/container_internal_common.go:1431 — libpod/container_internal_common.go:1431-1440 | libpod/container_internal_common.go:1885-1894 — both copies are in the same file, so extract the 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) pkg/api/handlers/compat/containers_top.go:36 — pkg/api/handlers/compat/containers_top.go:36-45 | pkg/api/handlers/libpod/pods.go:399-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/containers_top.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.
  • Duplicated block (10 lines × 2) pkg/api/handlers/compat/images.go:65 — pkg/api/handlers/compat/images.go:65-74 | pkg/api/handlers/compat/images_remove.go:35-44 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images.go:65` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/api/handlers/compat/images.go:90 — pkg/api/handlers/compat/images.go:90-99 | pkg/api/handlers/compat/images.go:611-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images.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 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/images.go:198 — pkg/api/handlers/compat/images.go:198-207 | pkg/api/handlers/compat/images.go:529-538 — both copies are in the same file, so extract the 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) pkg/api/handlers/compat/images_remove.go:26 — pkg/api/handlers/compat/images_remove.go:26-35 | pkg/api/handlers/libpod/manifests.go:756-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 begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) pkg/api/handlers/compat/volumes.go:146 — pkg/api/handlers/compat/volumes.go:146-155 | pkg/api/handlers/libpod/volumes.go:43-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (10 lines × 2) pkg/api/handlers/libpod/images.go:713 — pkg/api/handlers/libpod/images.go:713-722 | pkg/api/handlers/libpod/kube.go:225-234 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:713` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) pkg/api/handlers/libpod/images.go:733 — pkg/api/handlers/libpod/images.go:733-742 | pkg/api/handlers/libpod/manifests.go:779-788 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×17
  • Duplicated block (11 lines × 2) cmd/podman/artifact/list.go:155 — cmd/podman/artifact/list.go:155-165 | cmd/podman/machine/list.go:127-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:155` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) cmd/podman/artifact/pull.go:103 — cmd/podman/artifact/pull.go:103-113 | cmd/podman/images/pull.go:168-178 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `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 (11 lines × 2) cmd/podman/networks/list.go:135 — cmd/podman/networks/list.go:135-145 | cmd/podman/secrets/list.go:118-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. The matched lines also transfer control out of the body holding them, which cannot 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/pod.go:462 — libpod/pod.go:462-472 | libpod/pod_api.go:596-606 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) libpod/sqlite_state.go:874 — libpod/sqlite_state.go:874-884 | libpod/sqlite_state.go:1626-1636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:874` it does not close everything it opens, so those exact lines 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/bindings/containers/attach.go:116 — pkg/bindings/containers/attach.go:116-126 | pkg/bindings/containers/attach.go:453-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/bindings/containers/attach.go:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/bindings/images/build.go:1238 — pkg/bindings/images/build.go:1238-1248 | pkg/bindings/images/build.go:1256-1266 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/bindings/images/build.go:1238` it does not close everything it opens, so those exact lines 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/bindings/manifests/manifests.go:277 — pkg/bindings/manifests/manifests.go:277-287 | pkg/bindings/images/pull.go:59-69 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/specgen/namespaces.go:175 — pkg/specgen/namespaces.go:175-186 | pkg/specgen/namespaces.go:216-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:175` it begins part-way through the construct above it, so those exact lines cannot be 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/specgenutil/volumes.go:676 — pkg/specgenutil/volumes.go:676-686 | pkg/specgenutil/volumes.go:730-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:676` it does not close everything it opens, so those exact lines 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/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: extract the block into a single shared function in that directory and call it from each site, 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 begins part-way through the construct above it, so those exact lines cannot be 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/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) pkg/api/handlers/compat/exec.go:153 — pkg/api/handlers/compat/exec.go:153-165 | pkg/api/handlers/compat/exec.go:230-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/exec.go:153` it begins part-way through the construct above it, so those exact lines 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/api/handlers/compat/images_push.go:42 — pkg/api/handlers/compat/images_push.go:42-55 | pkg/api/handlers/compat/images_search.go:30-40 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) pkg/api/handlers/compat/volumes.go:230 — pkg/api/handlers/compat/volumes.go:230-240 | pkg/api/handlers/libpod/volumes.go:183-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/volumes.go:230` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pkg/api/handlers/libpod/pods.go:322 — pkg/api/handlers/libpod/pods.go:322-332 | pkg/domain/infra/abi/pods.go:301-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/api/handlers/libpod/volumes.go:69 — pkg/api/handlers/libpod/volumes.go:69-79 | pkg/domain/infra/abi/volumes.go:38-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×16
  • Duplicated block (8 lines × 2) cmd/podman/artifact/push.go:80 — cmd/podman/artifact/push.go:80-88 | cmd/podman/images/push.go:113-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. 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 (8 lines × 2) libpod/container.go:871 — libpod/container.go:871-878 | libpod/container.go:883-890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) pkg/machine/env/dir.go:18 — pkg/machine/env/dir.go:18-25 | pkg/machine/env/dir.go:112-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) pkg/specgen/volumes.go:186 — pkg/specgen/volumes.go:186-193 | pkg/specgen/volumes.go:201-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) pkg/util/utils.go:422 — pkg/util/utils.go:422-429 | pkg/util/utils.go:873-880 — both copies are in the same file, so extract the 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. 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 (8 lines × 2) cmd/podman/containers/pause.go:63 — cmd/podman/containers/pause.go:63-70 | cmd/podman/containers/unpause.go:61-68 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/pause.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 (8 lines × 2) pkg/api/handlers/compat/containers_stats.go:27 — pkg/api/handlers/compat/containers_stats.go:27-34 | pkg/api/handlers/compat/events.go:35-43 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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:27` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) pkg/api/handlers/compat/images.go:118 — pkg/api/handlers/compat/images.go:118-125 | pkg/api/handlers/libpod/images.go:508-515 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images.go:118` it begins part-way through the construct above it, so those exact lines 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.go:435 — pkg/api/handlers/compat/images.go:435-444 | pkg/api/handlers/libpod/pods.go:484-491 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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:435` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) pkg/api/handlers/compat/networks.go:468 — pkg/api/handlers/compat/networks.go:468-475 | pkg/api/handlers/compat/volumes.go:282-289 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. 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 (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 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/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 matched lines also transfer control out of the body holding them, which cannot 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/libpod/images.go:690 — pkg/api/handlers/libpod/images.go:690-697 | pkg/api/handlers/libpod/manifests.go:757-766 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:690` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (8 lines × 2) pkg/api/handlers/libpod/images_push.go:41 — pkg/api/handlers/libpod/images_push.go:41-48 | pkg/api/handlers/libpod/manifests.go:367-376 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images_push.go:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (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/play.go:1028 — pkg/domain/infra/abi/play.go:1028-1035 | pkg/domain/infra/abi/play.go:1149-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1028` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) pkg/specgen/generate/security_linux.go:34 — pkg/specgen/generate/security_linux.go:34-41 | pkg/specgen/generate/security_linux.go:48-55 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/specgen/generate/security_linux.go:34` it begins part-way through the construct above it, so those exact lines cannot be 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) · ×13
  • Duplicated block (12 lines × 2) cmd/podman/containers/mount.go:108 — cmd/podman/containers/mount.go:108-119 | cmd/podman/images/mount.go:82-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/mount.go:108` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 lines × 2) pkg/bindings/volumes/rename.go:12 — pkg/bindings/volumes/rename.go:12-23 | pkg/bindings/containers/rename.go:12-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) pkg/domain/filters/containers.go:192 — pkg/domain/filters/containers.go:192-203 | pkg/domain/filters/containers.go:506-517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:192` it does not close everything it opens, so those exact lines 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/containers.go:953 — pkg/domain/infra/abi/containers.go:953-964 | pkg/domain/infra/abi/containers.go:982-993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:953` it begins part-way through the construct above it, so those exact lines 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/containers.go:1462 — pkg/domain/infra/abi/containers.go:1462-1473 | pkg/domain/infra/abi/images.go:169-180 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/containers.go:1462` it does not close everything it opens, so those exact lines 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/machine/ocipull/ociartifact.go:320 — pkg/machine/ocipull/ociartifact.go:320-331 | pkg/machine/ocipull/source.go:95-106 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. 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 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 begins part-way through the construct above it, so those exact lines cannot be 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/api/handlers/compat/networks.go:173 — pkg/api/handlers/compat/networks.go:173-185 | pkg/api/handlers/libpod/networks.go:88-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. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/networks.go:173` it begins part-way through the construct above it, so those exact lines cannot be 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/api/handlers/libpod/manifests.go:221 — pkg/api/handlers/libpod/manifests.go:221-232 | pkg/api/handlers/libpod/manifests.go:638-649 — both copies are in the same file, so extract the 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/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: extract the block into a single shared function in that directory and call it from each site, 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/domain/infra/abi/manifest.go:257 — pkg/domain/infra/abi/manifest.go:257-268 | pkg/domain/infra/tunnel/manifest.go:158-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/manifest.go:257` it begins part-way through the construct above it, so those exact lines cannot be 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/infra/abi/play.go:970 — pkg/domain/infra/abi/play.go:970-981 | pkg/domain/infra/abi/play.go:1059-1070 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/abi/play.go:970` it does not close everything it opens, so those exact lines 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/tunnel/images.go:126 — pkg/domain/infra/tunnel/images.go:126-137 | pkg/domain/infra/tunnel/images.go:289-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/images.go:126` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: libpod/container_internal_common.go libpod/container_internal_common.go — libpod/container_internal_common.go changed 5 times in last 90 days, max complexity 142. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: pkg/bindings/images/build.go pkg/bindings/images/build.go — pkg/bindings/images/build.go changed 5 times in last 90 days, max complexity 114. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: pkg/specgen/generate/kube/kube.go pkg/specgen/generate/kube/kube.go — pkg/specgen/generate/kube/kube.go changed 5 times in last 90 days, max complexity 102. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: libpod/runtime_ctr.go libpod/runtime_ctr.go — libpod/runtime_ctr.go changed 3 times in last 90 days, max complexity 98. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: libpod/oci_conmon_common.go libpod/oci_conmon_common.go — libpod/oci_conmon_common.go changed 5 times in last 90 days, max complexity 56. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: pkg/machine/shim/host.go pkg/machine/shim/host.go — pkg/machine/shim/host.go changed 6 times in last 90 days, max complexity 43. 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, cover the area it touches with tests, 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.
  • Hotspot: libpod/container_internal.go libpod/container_internal.go — libpod/container_internal.go changed 5 times in last 90 days, max complexity 51. 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, cover the area it touches with tests, 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.
  • Hotspot: libpod/runtime.go libpod/runtime.go — libpod/runtime.go changed 3 times in last 90 days, max complexity 67. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, 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.
  • Hotspot: cmd/podman/common/build.go cmd/podman/common/build.go — cmd/podman/common/build.go changed 2 times in last 90 days, max complexity 96. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: pkg/systemd/quadlet/quadlet.go pkg/systemd/quadlet/quadlet.go — pkg/systemd/quadlet/quadlet.go changed 3 times in last 90 days, max complexity 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×10
  • Duplicated block (13 lines × 2) cmd/podman/farm/build.go:90 — cmd/podman/farm/build.go:90-102 | cmd/podman/images/build.go:83-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `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 (13 lines × 2) libpod/container_api.go:50 — libpod/container_api.go:50-62 | libpod/container_internal.go:830-842 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_api.go:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (13 lines × 2) libpod/container_exec.go:279 — libpod/container_exec.go:279-291 | libpod/container_exec.go:333-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_exec.go: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 (13 lines × 2) libpod/container_exec.go:455 — libpod/container_exec.go:455-467 | libpod/container_exec.go:600-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 `libpod/container_exec.go:455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/api/handlers/libpod/artifacts.go:264 — pkg/api/handlers/libpod/artifacts.go:264-276 | pkg/api/handlers/libpod/images.go:394-406 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/artifacts.go:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) pkg/domain/infra/runtime_libpod.go:236 — pkg/domain/infra/runtime_libpod.go:236-248 | pkg/util/utils.go:979-991 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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 (13 lines × 2) pkg/systemd/parser/split.go:118 — pkg/systemd/parser/split.go:118-130 | pkg/systemd/parser/split.go:142-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/systemd/parser/split.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. The matched lines also transfer control out of the body holding them, which cannot 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/api/handlers/libpod/images_push.go:133 — pkg/api/handlers/libpod/images_push.go:133-145 | pkg/api/handlers/libpod/manifests.go:452-464 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images_push.go:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) pkg/domain/infra/abi/manifest.go:224 — pkg/domain/infra/abi/manifest.go:224-237 | pkg/domain/infra/abi/manifest.go:273-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/manifest.go:224` it does not close everything it opens, so those exact lines 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/pods.go:343 — pkg/domain/infra/abi/pods.go:343-355 | pkg/specgen/generate/pod_create.go:308-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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. 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 lines × 2) · ×9
  • Duplicated block (15 lines × 2) cmd/podman/system/info.go:103 — cmd/podman/system/info.go:103-117 | cmd/podman/machine/info.go:74-88 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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. 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/container_api.go:175 — libpod/container_api.go:175-189 | libpod/container_internal.go:1259-1273 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_api.go:175` it does not close everything it opens, so those exact lines cannot be 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/container_graph.go:489 — libpod/container_graph.go:489-503 | libpod/container_graph.go:561-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 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:1560 — libpod/sqlite_state.go:1560-1574 | libpod/sqlite_state.go:1601-1615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1560` it does not close everything it opens, so those exact lines cannot be 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/bindings/containers/attach.go:189 — pkg/bindings/containers/attach.go:189-203 | pkg/bindings/containers/attach.go:497-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/bindings/containers/attach.go: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 (15 lines × 2) pkg/systemd/generate/containers.go:290 — pkg/systemd/generate/containers.go:290-304 | pkg/systemd/generate/pods.go:275-289 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/systemd/generate/containers.go:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) pkg/api/handlers/compat/containers_restart.go:50 — pkg/api/handlers/compat/containers_restart.go:50-64 | pkg/api/handlers/compat/containers_stop.go:70-84 — 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 4 separate duplicated blocks between them, totalling at least 46 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:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) pkg/domain/infra/abi/play.go:260 — pkg/domain/infra/abi/play.go:260-274 | pkg/domain/infra/abi/play.go:1699-1713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:260` it does not close everything it opens, so those exact lines cannot be 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 lines × 2) · ×9
  • Duplicated block (14 lines × 2) cmd/podman/artifact/pull.go:120 — cmd/podman/artifact/pull.go:120-133 | cmd/podman/images/pull.go:203-216 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/pull.go:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) libpod/oci_conmon_exec_common.go:53 — libpod/oci_conmon_exec_common.go:53-68 | libpod/oci_conmon_exec_common.go:118-131 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 2) pkg/api/handlers/libpod/artifacts.go:110 — pkg/api/handlers/libpod/artifacts.go:110-123 | pkg/api/handlers/libpod/images_pull.go:98-111 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, 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. 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 (14 lines × 2) pkg/domain/filters/containers.go:216 — pkg/domain/filters/containers.go:216-229 | pkg/domain/filters/containers.go:530-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:216` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) pkg/domain/filters/containers.go:409 — pkg/domain/filters/containers.go:409-422 | pkg/domain/filters/containers.go:430-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/filters/containers.go:409` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/domain/infra/runtime_libpod.go:264 — pkg/domain/infra/runtime_libpod.go:264-277 | pkg/util/utils.go:1001-1014 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/domain/infra/runtime_libpod.go:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (14 lines × 2) pkg/systemd/generate/containers.go:495 — pkg/systemd/generate/containers.go:495-508 | pkg/systemd/generate/pods.go:379-393 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (14 lines × 2) pkg/systemd/parser/unitfile.go:710 — pkg/systemd/parser/unitfile.go:710-723 | pkg/systemd/parser/unitfile.go:743-756 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/systemd/parser/unitfile.go:710` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/domain/infra/abi/play.go:1006 — pkg/domain/infra/abi/play.go:1006-1019 | pkg/domain/infra/abi/play.go:1102-1115 — both copies are in the same file, so extract the 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 (6 lines × 2) · ×9
  • Duplicated block (6 lines × 2) libpod/container_internal_linux.go:499 — libpod/container_internal_linux.go:499-504 | libpod/options.go:867-872 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/container_internal_linux.go:499` it does not close everything it opens, so those exact lines 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/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/domain/infra/abi/containers.go:257 — pkg/domain/infra/abi/containers.go:257-262 | pkg/domain/infra/abi/containers.go:278-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:257` it does not close everything it opens, so those exact lines 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/container_internal_common.go:455 — libpod/container_internal_common.go:455-460 | libpod/container_internal_common.go:1790-1795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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_common.go:455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) pkg/api/handlers/compat/system.go:24 — pkg/api/handlers/compat/system.go:24-29 | pkg/api/handlers/libpod/system.go:63-68 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, 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/system.go:24` it does not close everything it opens, so those exact lines 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/kube.go:230 — pkg/api/handlers/libpod/kube.go:230-235 | pkg/api/handlers/libpod/networks.go:39-44 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/kube.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) pkg/api/handlers/libpod/manifests.go:374 — pkg/api/handlers/libpod/manifests.go:374-380 | pkg/api/handlers/libpod/quadlets.go:283-288 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) pkg/domain/infra/abi/images.go:832 — pkg/domain/infra/abi/images.go:832-839 | pkg/domain/infra/abi/images.go:883-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) pkg/domain/infra/tunnel/containers.go:594 — pkg/domain/infra/tunnel/containers.go:594-599 | pkg/domain/infra/tunnel/containers.go:955-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:594` it does not close everything it opens, so those 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) · ×7
  • Duplicated block (7 lines × 2) libpod/oci_conmon_common.go:195 — libpod/oci_conmon_common.go:195-201 | libpod/oci_conmon_common.go:214-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/oci_conmon_common.go:195` it does not close everything it opens, so those exact lines 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.go:2229 — libpod/sqlite_state.go:2229-2235 | libpod/sqlite_state.go:2272-2278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:2229` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, 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 (7 lines × 2) libpod/container_internal_common.go:2919 — libpod/container_internal_common.go:2919-2925 | libpod/container_internal_common.go:2965-2971 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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_common.go:2919` it does not close everything it opens, so those exact lines cannot be 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/images_prune.go:25 — pkg/api/handlers/compat/images_prune.go:25-31 | pkg/api/handlers/compat/volumes.go:28-37 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/compat/images_prune.go:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) pkg/api/handlers/compat/secrets.go:23 — pkg/api/handlers/compat/secrets.go:23-29 | pkg/api/handlers/libpod/volumes.go:120-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 `pkg/api/handlers/compat/secrets.go:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) pkg/api/handlers/libpod/images.go:184 — pkg/api/handlers/libpod/images.go:184-191 | pkg/api/handlers/libpod/images.go:265-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/images.go:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot 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/specgenutil/specgen.go:1079 — pkg/specgenutil/specgen.go:1079-1085 | pkg/specgenutil/specgen.go:1101-1107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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:1079` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · Medium · ×6
  • Medium: math-random-used libpod/healthcheck_linux.go:9 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used libpod/kube.go:10 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used libpod/namesgenerator/names-generator.go:20 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used libpod/runtime_pre_go1.20.go:8 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: use-tls pkg/api/server/server.go:301 — Found an HTTP server without TLS. Use 'http.ListenAndServeTLS' instead. See https://golang.org/pkg/net/http/#ListenAndServeTLS for more information. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
  • Medium: avoid-bind-to-all-interfaces utils/ports.go:11 — Detected a network listener listening on 0.0.0.0 or an empty string. This could unexpectedly expose the server publicly as it binds to all available interfaces. Instead, specify another IP address that is not 0.0.0.0 nor the empty string. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) cmd/podman/artifact/push.go:139 — cmd/podman/artifact/push.go:139-154 | cmd/podman/images/push.go:168-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/artifact/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 (16 lines × 2) libpod/oci_conmon_common.go:621 — libpod/oci_conmon_common.go:621-636 | libpod/oci_conmon_exec_common.go:636-651 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/oci_conmon_common.go:621` it does not close everything it opens, so those exact lines 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/bindings/manifests/manifests.go:81 — pkg/bindings/manifests/manifests.go:81-96 | pkg/bindings/manifests/manifests.go:119-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/bindings/manifests/manifests.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 (16 lines × 2) pkg/machine/hyperv/hutil.go:62 — pkg/machine/hyperv/hutil.go:62-77 | pkg/machine/hyperv/hutil.go:97-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/hyperv/hutil.go:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: config.go ↔ machine.go pkg/machine/applehv/config.go — `pkg/machine/applehv/config.go` and `pkg/machine/applehv/machine.go` change together 82% of the time (9 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
  • Change coupling: config.go ↔ machine.go pkg/machine/qemu/config.go — `pkg/machine/qemu/config.go` and `pkg/machine/qemu/machine.go` change together 79% of the time (11 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
  • Change coupling: vfkit.go ↔ helper.go pkg/machine/apple/vfkit.go — `pkg/machine/apple/vfkit.go` and `pkg/machine/apple/vfkit/helper.go` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) pkg/api/handlers/libpod/containers.go:164 — pkg/api/handlers/libpod/containers.go:164-173 | pkg/api/handlers/compat/containers_pause.go:14-25 | pkg/api/handlers/compat/containers_unpause.go:14-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/api/handlers/libpod/containers.go:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 3) cmd/podman/containers/pause.go:94 — cmd/podman/containers/pause.go:94-103 | cmd/podman/containers/restart.go:106-115 | cmd/podman/containers/unpause.go:92-101 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `cmd/podman/containers/pause.go:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) pkg/api/handlers/compat/containers.go:80 — pkg/api/handlers/compat/containers.go:80-89 | pkg/api/handlers/compat/containers_restart.go:48-58 | 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 4 separate duplicated blocks between them, totalling at least 46 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:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×3
  • Duplicated block (6 lines × 3) libpod/oci_conmon_common.go:412 — libpod/oci_conmon_common.go:412-417 | libpod/oci_conmon_common.go:422-427 | libpod/oci_conmon_common.go:432-437 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) pkg/api/handlers/libpod/artifacts.go:73 — pkg/api/handlers/libpod/artifacts.go:73-78 | pkg/api/handlers/libpod/artifacts.go:234-239 | pkg/api/handlers/libpod/artifacts.go:257-262 — 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/artifacts.go:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 3) pkg/api/handlers/compat/containers.go:233 — pkg/api/handlers/compat/containers.go:233-240 | pkg/api/handlers/libpod/containers_stats.go:33-40 | pkg/api/handlers/libpod/kube.go:229-234 — 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.
D1 · Cyclomatic Complexity · ContainerEngine.ContainerStart (cyclomatic 17) · ×2
  • ContainerEngine.ContainerStart (cyclomatic 17) pkg/domain/infra/abi/containers.go:1037 — ContainerEngine.ContainerStart has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • ContainerEngine.ContainerStart (cyclomatic 17) pkg/domain/infra/tunnel/containers.go:790 — 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.
D31 · IaC & Container Security · Medium IaC · ×2
  • Medium IaC: DS-0001 contrib/hello/Containerfile — ':latest' tag used A `:latest` base pins nothing: the stage rebuilds against whatever that tag points at on the day, so the same commit produces different images and a change you did not make arrives without a diff. The step: pin the base to a concrete release and, where the registry offers one, its digest — `FROM alpine:3.21@sha256:…` — then bump it deliberately, which is a review a bot can raise. A build stage that only compiles is worth pinning for the same reason: it decides what ends up in the layers you ship.
  • Medium IaC: DS-0001 contrib/validatepr/Containerfile — ':latest' tag used A `:latest` base pins nothing: the stage rebuilds against whatever that tag points at on the day, so the same commit produces different images and a change you did not make arrives without a diff. The step: pin the base to a concrete release and, where the registry offers one, its digest — `FROM alpine:3.21@sha256:…` — then bump it deliberately, which is a review a bot can raise. A build stage that only compiles is worth pinning for the same reason: it decides what ends up in the layers you ship.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) libpod/oci_conmon_common.go:652 — libpod/oci_conmon_common.go:652-670 | libpod/oci_conmon_exec_common.go:659-677 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/oci_conmon_common.go:652` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) libpod/boltdb_state_internal.go:222 — libpod/boltdb_state_internal.go:222-241 | libpod/sqlite_state_internal.go:300-318 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/boltdb_state_internal.go:222` it begins part-way through the construct above it, so those 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 (11 lines × 3) · ×2
  • Duplicated block (11 lines × 3) cmd/podman/common/completion.go:187 — cmd/podman/common/completion.go:187-197 | cmd/podman/common/completion.go:210-220 | cmd/podman/common/completion.go:367-377 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 3) pkg/api/handlers/libpod/containers.go:78 — pkg/api/handlers/libpod/containers.go:78-88 | pkg/api/handlers/compat/containers.go:112-122 | pkg/api/handlers/libpod/images.go:127-138 — 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/libpod/containers.go:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) libpod/sqlite_state.go:846 — libpod/sqlite_state.go:846-854 | libpod/sqlite_state.go:876-884 | libpod/sqlite_state.go:1628-1636 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libpod/sqlite_state.go:846` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 3) pkg/api/handlers/compat/secrets.go:61 — pkg/api/handlers/compat/secrets.go:61-69 | pkg/api/handlers/libpod/kube.go:254-263 | pkg/api/handlers/libpod/system.go:83-91 — 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/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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) libpod/runtime_volume_common.go:173 — libpod/runtime_volume_common.go:173-177 | libpod/runtime_volume_common.go:217-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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_volume_common.go:173` it does not close everything it opens, so those exact lines cannot be 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:44 — pkg/api/handlers/compat/networks.go:44-48 | pkg/api/handlers/compat/networks.go:340-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. The matched lines also transfer control out of the body holding them, 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 194) · ×1
  • specgenutil.FillOutSpecGen (cyclomatic 194) pkg/specgenutil/specgen.go:324 — specgenutil.FillOutSpecGen has cyclomatic complexity 194 (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.generateSpec (cyclomatic 142) · ×1
  • Container.generateSpec (cyclomatic 142) libpod/container_internal_common.go:235 — Container.generateSpec has cyclomatic complexity 142 (threshold 15). Of this number, 140 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:621 — 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 114) · ×1
  • images.prepareParams (cyclomatic 114) pkg/bindings/images/build.go:135 — images.prepareParams has cyclomatic complexity 114 (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 · kube.ToSpecGen (cyclomatic 102) · ×1
  • kube.ToSpecGen (cyclomatic 102) pkg/specgen/generate/kube/kube.go:202 — kube.ToSpecGen has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 101) · ×1
  • Container.restore (cyclomatic 101) libpod/container_internal_common.go:1557 — Container.restore has cyclomatic complexity 101 (threshold 15). Of this number, 95 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generate.createContainerOptions (cyclomatic 100) · ×1
  • generate.createContainerOptions (cyclomatic 100) pkg/specgen/generate/container_create.go:357 — generate.createContainerOptions has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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:294 — 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 · filters.GenerateContainerFilterFuncs (cyclomatic 90) · ×1
  • filters.GenerateContainerFilterFuncs (cyclomatic 90) pkg/domain/filters/containers.go:23 — filters.GenerateContainerFilterFuncs has cyclomatic complexity 90 (threshold 15). Of this number, 44 points are the body's own statements and 46 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 · compat.cliOpts (cyclomatic 86) · ×1
  • compat.cliOpts (cyclomatic 86) pkg/api/handlers/compat/containers_create.go:153 — compat.cliOpts has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 86) · ×1
  • compat.createBuildOptions (cyclomatic 86) pkg/api/handlers/compat/images_build.go:346 — compat.createBuildOptions has cyclomatic complexity 86 (threshold 15). Of this number, 82 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generate.MakeContainer (cyclomatic 84) · ×1
  • generate.MakeContainer (cyclomatic 84) pkg/specgen/generate/container_create.go:33 — generate.MakeContainer has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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:705 — Runtime.removeContainer has cyclomatic complexity 80 (threshold 15). Of this number, 78 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generate.SpecGenToOCI (cyclomatic 70) · ×1
  • generate.SpecGenToOCI (cyclomatic 70) pkg/specgen/generate/oci_linux.go:103 — generate.SpecGenToOCI has cyclomatic complexity 70 (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.platformInspectContainerHostConfig (cyclomatic 69) · ×1
  • Container.platformInspectContainerHostConfig (cyclomatic 69) libpod/container_inspect_linux.go:19 — Container.platformInspectContainerHostConfig has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 67) · ×1
  • libpod.makeRuntime (cyclomatic 67) libpod/runtime.go:329 — libpod.makeRuntime has cyclomatic complexity 67 (threshold 15). Of this number, 58 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 · util.processOptionsInternal (cyclomatic 66) · ×1
  • util.processOptionsInternal (cyclomatic 66) pkg/util/mount_opts.go:36 — util.processOptionsInternal has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · quadlet.ConvertContainer (cyclomatic 63) · ×1
  • quadlet.ConvertContainer (cyclomatic 63) pkg/systemd/quadlet/quadlet.go:601 — 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 · generate.securityConfigureGenerator (cyclomatic 62) · ×1
  • generate.securityConfigureGenerator (cyclomatic 62) pkg/specgen/generate/security_linux.go:86 — generate.securityConfigureGenerator 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 · ContainerEngine.PlayKube (cyclomatic 61) · ×1
  • ContainerEngine.PlayKube (cyclomatic 61) pkg/domain/infra/abi/play.go:234 — ContainerEngine.PlayKube has cyclomatic complexity 61 (threshold 15). Of this number, 53 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 · generate.CompleteSpec (cyclomatic 61) · ×1
  • generate.CompleteSpec (cyclomatic 61) pkg/specgen/generate/container.go:140 — generate.CompleteSpec has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 60) · ×1
  • filters.GenerateExternalContainerFilterFuncs (cyclomatic 60) pkg/domain/filters/containers.go:352 — filters.GenerateExternalContainerFilterFuncs has cyclomatic complexity 60 (threshold 15). Of this number, 38 points are the body's own statements and 22 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 · Container.makeBindMounts (cyclomatic 58) · ×1
  • Container.makeBindMounts (cyclomatic 58) libpod/container_internal_common.go:2001 — 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) libpod/oci_conmon_common.go:994 — 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 · generate.specConfigureNamespaces (cyclomatic 52) · ×1
  • generate.specConfigureNamespaces (cyclomatic 52) pkg/specgen/generate/namespaces_linux.go:18 — generate.specConfigureNamespaces has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 51) · ×1
  • containers.CreateInit (cyclomatic 51) cmd/podman/containers/create.go:232 — containers.CreateInit has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.mountStorage (cyclomatic 51) · ×1
  • Container.mountStorage (cyclomatic 51) libpod/container_internal.go:1694 — 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) pkg/bindings/containers/attach.go: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 · pods.create (cyclomatic 50) · ×1
  • pods.create (cyclomatic 50) cmd/podman/pods/create.go:106 — pods.create has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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 49) · ×1
  • Runtime.newVolume (cyclomatic 49) libpod/runtime_volume_common.go:48 — Runtime.newVolume has cyclomatic complexity 49 (threshold 15). Of this number, 45 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.ConfigToSpec (cyclomatic 49) · ×1
  • generate.ConfigToSpec (cyclomatic 49) pkg/specgen/generate/container.go:379 — 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 · 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:94 — 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 · 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 · shim.startLocked (cyclomatic 43) · ×1
  • shim.startLocked (cyclomatic 43) pkg/machine/shim/host.go:557 — shim.startLocked has cyclomatic complexity 43 (threshold 15). Of this number, 40 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 · SpecGenerator.Validate (cyclomatic 43) · ×1
  • SpecGenerator.Validate (cyclomatic 43) pkg/specgen/container_validate.go:27 — SpecGenerator.Validate 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 · 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:266 — 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:108 — 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) libpod/kube.go:910 — 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 · 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) libpod/container_internal_common.go:2842 — 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 · common.ParseBuildOpts (cyclomatic 40) · ×1
  • common.ParseBuildOpts (cyclomatic 40) cmd/podman/common/build.go:145 — common.ParseBuildOpts 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 · libpod.GetLimits (cyclomatic 40) · ×1
  • libpod.GetLimits (cyclomatic 40) libpod/oci_conmon_linux.go:234 — libpod.GetLimits has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.HTTPAttach (cyclomatic 40) · ×1
  • ConmonOCIRuntime.HTTPAttach (cyclomatic 40) libpod/oci_conmon_common.go:458 — 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 · shim.Init (cyclomatic 40) · ×1
  • shim.Init (cyclomatic 40) pkg/machine/shim/host.go:71 — 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 · specgen.GenVolumeMounts (cyclomatic 40) · ×1
  • specgen.GenVolumeMounts (cyclomatic 40) pkg/specgen/volumes.go:89 — specgen.GenVolumeMounts 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 · 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 · compat.LibpodToContainerJSON (cyclomatic 38) · ×1
  • compat.LibpodToContainerJSON (cyclomatic 38) pkg/api/handlers/compat/containers.go:495 — 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 · ContainerEngine.PlayKubeDown (cyclomatic 38) · ×1
  • ContainerEngine.PlayKubeDown (cyclomatic 38) pkg/domain/infra/abi/play.go:1690 — ContainerEngine.PlayKubeDown 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 · utils.ExecuteTransfer (cyclomatic 38) · ×1
  • utils.ExecuteTransfer (cyclomatic 38) pkg/domain/utils/scp.go:20 — utils.ExecuteTransfer 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 · kube.play (cyclomatic 37) · ×1
  • kube.play (cyclomatic 37) cmd/podman/kube/play.go:217 — kube.play has cyclomatic complexity 37 (threshold 15). Of this number, 35 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 · Container.runHealthCheck (cyclomatic 36) · ×1
  • Container.runHealthCheck (cyclomatic 36) libpod/healthcheck.go:54 — Container.runHealthCheck 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.LibpodToContainer (cyclomatic 36) · ×1
  • compat.LibpodToContainer (cyclomatic 36) pkg/api/handlers/compat/containers.go:308 — 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 · inspector.inspect (cyclomatic 35) · ×1
  • inspector.inspect (cyclomatic 35) cmd/podman/inspect/inspect.go:77 — 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) libpod/kube.go:743 — 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) pkg/bindings/containers/attach.go:386 — 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) pkg/bindings/images/build.go:1111 — 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 1126, 1275). 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.ContainerRun (cyclomatic 35) · ×1
  • ContainerEngine.ContainerRun (cyclomatic 35) pkg/domain/infra/abi/containers.go:1181 — ContainerEngine.ContainerRun has cyclomatic complexity 35 (threshold 15). 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, separate the cases: extract each independent branch into its 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.WaitForConditionWithInterval (cyclomatic 34) · ×1
  • Container.WaitForConditionWithInterval (cyclomatic 34) libpod/container_api.go:733 — Container.WaitForConditionWithInterval has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 13 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 786, 771). 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 · Container.update (cyclomatic 34) · ×1
  • Container.update (cyclomatic 34) libpod/container_internal.go:2785 — Container.update has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · compat.PushImage (cyclomatic 34) · ×1
  • compat.PushImage (cyclomatic 34) pkg/api/handlers/compat/images_push.go:27 — compat.PushImage has cyclomatic complexity 34 (threshold 15). Of this number, 31 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 · images.prepareRemoteRequestBody (cyclomatic 34) · ×1
  • images.prepareRemoteRequestBody (cyclomatic 34) pkg/bindings/images/build.go:692 — 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 · Container.fixVolumePermissionsUnlocked (cyclomatic 32) · ×1
  • Container.fixVolumePermissionsUnlocked (cyclomatic 32) libpod/container_internal_common.go:3029 — 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:119 — SQLiteState.Refresh has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.process (cyclomatic 31) · ×1
  • main.process (cyclomatic 31) cmd/quadlet/main.go:441 — main.process has cyclomatic complexity 31 (threshold 15). 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, separate the cases: extract each independent branch into its 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.addSharedNamespaces (cyclomatic 31) · ×1
  • Container.addSharedNamespaces (cyclomatic 31) libpod/container_internal_linux.go:406 — Container.addSharedNamespaces 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 · 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:60 — 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:172 — generate.MapSpec has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · specgenutil.GetResources (cyclomatic 31) · ×1
  • specgenutil.GetResources (cyclomatic 31) pkg/specgenutil/specgen.go:1285 — 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.copyFromArchive (cyclomatic 30) · ×1
  • Container.copyFromArchive (cyclomatic 30) libpod/container_copy_common.go:26 — Container.copyFromArchive has cyclomatic complexity 30 (threshold 15). 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, separate the cases: extract each independent branch into its 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 30) · ×1
  • Container.checkpoint (cyclomatic 30) libpod/container_internal_common.go:1328 — Container.checkpoint has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · 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) libpod/kube.go:570 — 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:369 — 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:304 — SQLiteState.ValidateDBConfig has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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:493 — libpod.attachExecHTTP has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Runtime.SystemCheck (cyclomatic 29) · ×1
  • Runtime.SystemCheck (cyclomatic 29) libpod/runtime.go:1352 — 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.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:1456 — 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 · Container.setupStorage (cyclomatic 28) · ×1
  • Container.setupStorage (cyclomatic 28) libpod/container_internal.go:450 — Container.setupStorage has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.exportCheckpoint (cyclomatic 28) · ×1
  • Container.exportCheckpoint (cyclomatic 28) libpod/container_internal_common.go:1124 — Container.exportCheckpoint 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.evictContainer (cyclomatic 28) · ×1
  • Runtime.evictContainer (cyclomatic 28) libpod/runtime_ctr.go:1078 — Runtime.evictContainer has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · compat.UpdateContainer (cyclomatic 28) · ×1
  • compat.UpdateContainer (cyclomatic 28) pkg/api/handlers/compat/containers.go:766 — compat.UpdateContainer has cyclomatic complexity 28 (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.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) libpod/container_exec.go: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.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:411 — 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:205 — 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) pkg/util/utils.go:958 — 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:204 — 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:338 — 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) libpod/kube.go:444 — 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:64 — Container.getContainerInspectData has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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:190 — 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:51 — 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 · ConmonOCIRuntime.createRootlessContainer (cyclomatic 25) · ×1
  • ConmonOCIRuntime.createRootlessContainer (cyclomatic 25) libpod/oci_conmon_linux.go:30 — ConmonOCIRuntime.createRootlessContainer has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to one function literal inside it that branches (line 36). 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 · Runtime.mergeDBConfig (cyclomatic 25) · ×1
  • Runtime.mergeDBConfig (cyclomatic 25) libpod/runtime.go:1101 — 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 · compat.handleBuildContexts (cyclomatic 25) · ×1
  • compat.handleBuildContexts (cyclomatic 25) pkg/api/handlers/compat/images_build.go:1135 — compat.handleBuildContexts has cyclomatic complexity 25 (threshold 15). Of this number, 21 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 · bindings.sshClient (cyclomatic 25) · ×1
  • bindings.sshClient (cyclomatic 25) pkg/bindings/connection.go: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 · ContainerEngine.SetupRootless (cyclomatic 25) · ×1
  • ContainerEngine.SetupRootless (cyclomatic 25) pkg/domain/infra/abi/system_linux.go:24 — ContainerEngine.SetupRootless 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.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 · Container.generateInspectContainerHostConfig (cyclomatic 24) · ×1
  • Container.generateInspectContainerHostConfig (cyclomatic 24) libpod/container_inspect.go:488 — Container.generateInspectContainerHostConfig has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Container.cleanup (cyclomatic 24) · ×1
  • Container.cleanup (cyclomatic 24) libpod/container_internal.go:2171 — Container.cleanup has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · events.generateEventFilter (cyclomatic 24) · ×1
  • events.generateEventFilter (cyclomatic 24) libpod/events/filters.go:13 — events.generateEventFilter has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 76, 16, 33, …). 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 · generate.MakePod (cyclomatic 24) · ×1
  • generate.MakePod (cyclomatic 24) pkg/specgen/generate/pod_create.go:23 — generate.MakePod has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kube.setupSecurityContext (cyclomatic 24) · ×1
  • kube.setupSecurityContext (cyclomatic 24) pkg/specgen/generate/kube/kube.go:960 — kube.setupSecurityContext 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 · specgenutil.parseSecrets (cyclomatic 24) · ×1
  • specgenutil.parseSecrets (cyclomatic 24) pkg/specgenutil/specgen.go:1119 — 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.ConvertVolume (cyclomatic 24) · ×1
  • quadlet.ConvertVolume (cyclomatic 24) pkg/systemd/quadlet/quadlet.go:1105 — quadlet.ConvertVolume 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:1231 — 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:88 — 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 · 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) libpod/container_exec.go: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.prepareProcessExec (cyclomatic 23) · ×1
  • Container.prepareProcessExec (cyclomatic 23) libpod/oci_conmon_exec_common.go:681 — Container.prepareProcessExec has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConmonOCIRuntime.startExec (cyclomatic 23) · ×1
  • ConmonOCIRuntime.startExec (cyclomatic 23) libpod/oci_conmon_exec_common.go:328 — ConmonOCIRuntime.startExec has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · 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 · ContainerEngine.ContainerRun (cyclomatic 23) · ×1
  • ContainerEngine.ContainerRun (cyclomatic 23) pkg/domain/infra/tunnel/containers.go:888 — ContainerEngine.ContainerRun has cyclomatic complexity 23 (threshold 15). Of this number, 20 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.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:53 — 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:64 — 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) pkg/util/utils.go:354 — 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 · images.imagePull (cyclomatic 22) · ×1
  • images.imagePull (cyclomatic 22) cmd/podman/images/pull.go:144 — images.imagePull 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) libpod/kube.go:1373 — 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:1897 — 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:2018 — 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) libpod/oci_conmon_attach_common.go: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:1801 — SQLiteState.RemovePodContainers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · libpod.CommitContainer (cyclomatic 22) · ×1
  • libpod.CommitContainer (cyclomatic 22) pkg/api/handlers/libpod/images.go:486 — libpod.CommitContainer has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.Sign (cyclomatic 22) · ×1
  • ImageEngine.Sign (cyclomatic 22) pkg/domain/infra/abi/images.go:699 — 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 713). 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:1766 — 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:42 — 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.ListContainerBatch (cyclomatic 22) · ×1
  • ps.ListContainerBatch (cyclomatic 22) pkg/ps/ps.go:170 — 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 189). 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) pkg/trust/policy.go:152 — 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 · 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) libpod/oci_conmon_common.go:1572 — 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) libpod/container_exec.go:1149 — 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 · EventLogFile.Read (cyclomatic 21) · ×1
  • EventLogFile.Read (cyclomatic 21) libpod/events/logfile.go:111 — EventLogFile.Read 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 3 function literals inside it that branch (lines 151, 125, 137). 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 · ConmonOCIRuntime.sharedConmonArgs (cyclomatic 21) · ×1
  • ConmonOCIRuntime.sharedConmonArgs (cyclomatic 21) libpod/oci_conmon_common.go:1299 — ConmonOCIRuntime.sharedConmonArgs has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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 · images.build (cyclomatic 21) · ×1
  • images.build (cyclomatic 21) pkg/bindings/images/build.go:999 — images.build has cyclomatic complexity 21 (threshold 15). 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: 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.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:300 — 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 323). 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 lite...

    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.