Public report — delve, 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 @ 09:38 UTC Public
Code Health Audit

Go-Delve/delve

54% Adequate
CriticalWeakAdequateStrongExemplary
lower third — near Weak

Medium · 78,224 LoC · rebuild ~0.9 person-years · weakest lens: Maturity (47%)

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

22/24dimensions tool-verifieddeterministic · confidence 1.0 · 2 LLM-assisted, advisory
518findings with an exact file:lineof 531 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
24/95dimensions across the health lenses78224 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.

go-delve/delve is sound in substance but carries real gaps (54%). 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.

The area that most needs attention is Maturity (47%) — onboarding is slow — key decisions and the architecture aren't written down, so contributors have to reverse-engineer the intent. Security (57%) is the next concern — exposure to security and compliance incidents is elevated.

Leadership focus, highest impact first: build/run (quick start) section to the root README (Documentation (README)); Reconcile the README with reality (Documentation accuracy); Record significant decisions one document per decision (Architecture documentation).

For scale: Medium (~78,224 production lines); rebuilding it from scratch would take roughly ~0.9 person-years (~1–2 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.
Maturity 47% · 47% weightSecurity 57% · 26% weightCode Health 58% · 14% weightReadiness 62% · 8% weightArchitecture 100% · 4% weight

Raise Maturity 47 → 70 (the Healthy floor) ⇒ headline 54 → ~61.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €43,000–€220,000
Cost to rebuild€43,000–€220,000 (0.4–1.4 person-years (716–2,270 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 54% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.9 person-years of build effort (about ~€130,000 to rebuild). Its weakest lens is Maturity at 47% — 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
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
+8.7 pts · Medium effort · Documentation (README)
2
Reconcile the README with reality: README claims bugs-only GitHub tracker but the evidence shows a developer mailing list for feature proposals; README omits any mention of the Go reference (pkg.go.dev) badge and its link to github.com/go-delve/delve.
+8.7 pts · Medium effort · Documentation accuracy
3
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
+8.5 pts · Medium effort · Architecture documentation

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 8.5–51.1 engineer-days every year, paid as drag on the ~44,741 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–14 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 8–17% 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: 11,032 line(s) changed over a 90-day window ⇒ ~44,741/year · D1/D2/D4 code quality: averaging 5.0/10 ⇒ a 8–17% 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 14 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.9 person-years to rebuild), and its weakest lens is Maturity at 47%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.9 person-years rebuild (78,224 LoC) · weakest lens: Maturity 47%
→ Direct remediation budget at Maturity first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a build/run (quick start) section to the root README — the first thing a newcomer needs. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.0/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 8–17% 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 5.0/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

50 modules, 98 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.)

_scripts…o-delve/delve/cmd/dlv…/dlv/cmds/helphelpers…lve/delve/pkg/astutil…delve/pkg/debugdetect…delve/delve/pkg/dwarf…lve/pkg/dwarf/godwarf…elve/pkg/dwarf/leb128…/delve/pkg/dwarf/line…ve/delve/pkg/dwarf/op…e/delve/pkg/elfwriter…e/delve/pkg/goversion…elve/pkg/internal/lru…ve/delve/pkg/logflags…pkg/terminal/colorize…delve/pkg/dwarf/frame…lve/pkg/dwarf/loclist…elve/pkg/dwarf/reader…lve/delve/pkg/locspec…ve/pkg/proc/amd64util…delve/pkg/proc/evalop…kg/proc/internal/ebpf…elve/pkg/proc/winutil…kg/proc/core/minidump…elve/pkg/proc/linutil…elve/service/debugger…e/delve/pkg/proc/core…o-delve/delve/service…pkg/terminal/starbind…-delve/delve/pkg/proc…lve/pkg/proc/fbsdutil…ve/pkg/proc/gdbserial…delve/pkg/proc/native…lve/delve/service/api…elve/delve/pkg/config…lve/delve/service/dap…ve/delve/service/rpc2…ve/delve/cmd/dlv/cmds…ve/delve/pkg/terminal…lve/service/rpccommon_scripts1…o-delve/delve/cmd/dlv2…/dlv/cmds/helphelpers3…lve/delve/pkg/astutil4…delve/pkg/debugdetect5…delve/delve/pkg/dwarf6…lve/pkg/dwarf/godwarf7…elve/pkg/dwarf/leb1288…/delve/pkg/dwarf/line9…ve/delve/pkg/dwarf/op10…e/delve/pkg/elfwriter11…e/delve/pkg/goversion12…elve/pkg/internal/lru13…ve/delve/pkg/logflags14…pkg/terminal/colorize15…delve/pkg/dwarf/frame16…lve/pkg/dwarf/loclist17…elve/pkg/dwarf/reader18…lve/delve/pkg/locspec19…ve/pkg/proc/amd64util20…delve/pkg/proc/evalop21…kg/proc/internal/ebpf22…elve/pkg/proc/winutil23…kg/proc/core/minidump24…elve/pkg/proc/linutil25…elve/service/debugger26…e/delve/pkg/proc/core27…o-delve/delve/service28…pkg/terminal/starbind29…-delve/delve/pkg/proc30…lve/pkg/proc/fbsdutil31…ve/pkg/proc/gdbserial32…delve/pkg/proc/native33…lve/delve/service/api34…elve/delve/pkg/config35…lve/delve/service/dap36…ve/delve/service/rpc237…ve/delve/cmd/dlv/cmds38…ve/delve/pkg/terminal39…lve/service/rpccommon4014215815312415217111242011218351251113751169184742625151011211112133311211123212324111113112110624181111114327211442+10 more modules (most-connected shown)

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

At a glance — Architecture · 100% · Exemplary

At a glance — Maturity · 47% · Weak · gated by M4

At a glance — Readiness · 62% · Adequate

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

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 — Injection39High / Critical
A06:2021 — Vulnerable & Outdated Components1Medium

Roadmap

First, establish a clear quick-start guide in the root README to help new contributors get started immediately. Next, correct the README to accurately reflect the project's current state, including the developer mailing list and Go package documentation. Then, introduce architecture decision records to capture significant design choices and their consequences in a central location. Additionally, integrate static analysis tools into the CI pipeline to automatically fail builds on regressions. Finally, implement a draft release process or manual approval gate to prevent bad builds from being published.

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

Do thisHelpsEffortDimension
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+8.7 ptsMediumDocumentation (README)
Reconcile the README with reality: README claims bugs-only GitHub tracker but the evidence shows a developer mailing list for feature proposals; README omits any mention of the Go reference (pkg.go.dev) badge and its link to github.com/go-delve/delve.+8.7 ptsMediumDocumentation accuracy
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).+8.5 ptsMediumArchitecture documentation
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.+3.0 ptsMediumSecurity & performance tooling
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+3.0 ptsMediumDeployment & Rollback
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.+3.0 ptsMediumRelease Hygiene
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness.+1.5 ptsLowKnowledge Freshness
Resolve the 3 Off-boarding risk finding(s) in Bus Factor.+1.1 ptsLowBus Factor

File quality

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

FileScoreBandWorst signal
.github/workflows/release.yml4.5MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
pkg/proc/arm64_arch.go5.6MixedCyclomatic Complexity: proc.arm64SwitchStack (cyclomatic 44)
pkg/proc/native/proc_windows.go6.0MixedCyclomatic Complexity: processGroup.waitForDebugEvent (cyclomatic 42)
service/dap/daptest/client.go6.3MixedCognitive Complexity: Client.CheckStopLocation (cognitive 20)
pkg/proc/core/minidump/minidump.go6.5MixedCyclomatic Complexity: minidump.Open (cyclomatic 28)
pkg/proc/eval.go7.0MixedCyclomatic Complexity: evalStack.executeOp (cyclomatic 65)
service/dap/server.go7.0MixedCyclomatic Complexity: Session.handleRequest (cyclomatic 57)
service/debugger/debugger.go7.0MixedCyclomatic Complexity: Debugger.Command (cyclomatic 55)
pkg/proc/native/proc_linux.go7.0MixedCyclomatic Complexity: native.trapWaitInternal (cyclomatic 53)
pkg/proc/variables.go7.0MixedCyclomatic Complexity: Variable.loadValueInternal (cyclomatic 46)
pkg/proc/stack.go7.0MixedCyclomatic Complexity: proc.rangeFuncStackTrace (cyclomatic 39)
pkg/proc/fncall.go7.0MixedCyclomatic Complexity: EvalScope.evalCallInjectionStart (cyclomatic 37)
pkg/proc/bininfo.go7.0MixedCyclomatic Complexity: BinaryInfo.loadDebugInfoMaps (cyclomatic 36)
pkg/proc/gdbserial/gdbserver_conn.go7.0MixedCyclomatic Complexity: gdbConn.parseStopPacket (cyclomatic 36)
pkg/terminal/command.go7.0MixedCyclomatic Complexity: terminal.setBreakpoint (cyclomatic 36)
pkg/proc/breakpoints.go7.0MixedCyclomatic Complexity: proc.breakpointConditionSatisfiable (cyclomatic 34)
pkg/proc/gdbserial/gdbserver.go7.0MixedCyclomatic Complexity: gdbserial.LLDBLaunch (cyclomatic 34)
pkg/terminal/terminal.go7.0MixedCyclomatic Complexity: Term.Run (cyclomatic 31)
cmd/dlv/cmds/commands.go7.0MixedCyclomatic Complexity: cmds.traceCmd (cyclomatic 45)
service/api/prettyprint.go7.0MixedCyclomatic Complexity: Variable.writeTo (cyclomatic 41)

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. 22 of 24 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 2 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.5 — 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 — 24 dimensions across the health lenses
D1D2D3D4D13D15D16D19D21D28D29D34D35D36D38AX5M1M2M3M4P1P3P4P6

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, 518 of 531 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 · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ 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 019fd670-8497-7605-989c-ee2f950023a4.

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 (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

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.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity (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.
  • 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.
  • 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").
  • 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 (3): D19, 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 Complexity3.2 / 10Weak✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 3.2 / 10 · rule-coverage 100% · ceiling Prevented

154 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was godwarf.readType at 94. A further 3 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 RISCV64Registers.GetReg at 33 — they are counted neither in the figure above nor in this dimension's score.

AMD64Registers.SetReg (cyclomatic 27) · ×2pkg/proc/fbsdutil/regs.go:186
godwarf.readType (cyclomatic 94)pkg/dwarf/godwarf/type.go:564
evalStack.executeOp (cyclomatic 65)pkg/proc/eval.go:1098
EvalScope.evalTypeCast (cyclomatic 61)pkg/proc/eval.go:1517
compileCtx.compileAST (cyclomatic 61)pkg/proc/evalop/evalcompile.go:293

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

What to do

  1. Resolve the 2 AMD64Registers.SetReg (cyclomatic 27) finding(s) in Cyclomatic Complexity — start with regs.go, regs_amd64_arch.go. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 godwarf.readType (cyclomatic 94) finding(s) in Cyclomatic Complexity — start with type.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 evalStack.executeOp (cyclomatic 65) finding(s) in Cyclomatic Complexity — start with eval.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

233 method(s) exceeded the cognitive complexity threshold of 15; the worst was godwarf.readType at 164.

godwarf.readType (cognitive 164)pkg/dwarf/godwarf/type.go:564
native.trapWaitInternal (cognitive 147)pkg/proc/native/proc_linux.go:440
cmds.traceCmd (cognitive 122)cmd/dlv/cmds/commands.go:672
processGroup.waitForDebugEvent (cognitive 109)pkg/proc/native/proc_windows.go:345
compileCtx.compileAST (cognitive 101)pkg/proc/evalop/evalcompile.go:293

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

What to do

  1. Resolve the 1 godwarf.readType (cognitive 164) finding(s) in Cognitive Complexity — start with type.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 native.trapWaitInternal (cognitive 147) finding(s) in Cognitive Complexity — start with proc_linux.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 cmds.traceCmd (cognitive 122) finding(s) in Cognitive Complexity — start with commands.go. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Prevented

33 god class(es) detected.

FileTooLong: dap/server.go · ×19service/dap/server.go:0
TooManyMethods: Client · ×14service/dap/daptest/client.go:24

What to do

  1. Resolve the 19 FileTooLong finding(s) in God Classes — start with server.go (2), command.go, eval.go. — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 14 TooManyMethods finding(s) in God Classes — start with client.go (2), server.go (2), debugger.go. — One of this dimension's main actionable groups (14 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication9.7 / 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.7 / 10 · rule-coverage 100% · ceiling Verified

48 duplicated block group(s) detected.

Duplicated block (12 lines × 2) · ×5pkg/dwarf/godwarf/addr.go:25
Duplicated block (11 lines × 2) · ×4pkg/dwarf/parseutil.go:33
Duplicated block (10 lines × 2) · ×4pkg/proc/eval.go:3043
Duplicated block (9 lines × 2) · ×4pkg/proc/eval.go:1628
Duplicated block (14 lines × 2) · ×3pkg/proc/breakpoints.go:952

+ 22 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.

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.3 / 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.3 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: service/dap/server.go (7×57=399); pkg/proc/stack.go (4×39=156); pkg/proc/eval.go (2×65=130)

Hotspot: service/dap/server.go · ×8service/dap/server.go

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.0 / 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.0 / 10 · rule-coverage 100% · ceiling Documented

13 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/proc/arm64_arch.go.

Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

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

Delve's documentation is comprehensive and well-structured across READMEs and markdown architecture docs: the main README links to a full table of contents (Installation, Getting Started, Documentation, Contributing) with each section present in the outline. The detailed Usage guide covers every major Delve command (debug, test, exec, attach, core, replay), its headless modes, DAP-only and multi-client options, and API versioning, while the API docs explain both JSON-RPC and DAP interfaces with code examples for each method. There is no architecture or design doc present in the set, so the outline falls strictly on the READMEs.

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.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)10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.4 / 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 0.4 / 10 · rule-coverage 100% · ceiling Documented

168 finding(s): 0 critical, 6 high, 0 medium, 162 low.

High: github-actions-mutable-action-tag · ×6.github/workflows/release.yml:38detected by semgrep finding
Low: use-of-unsafe-block · ×33pkg/debugdetect/detect_darwin.go:25detected by semgrep finding

What to do

  1. Resolve the 33 Low finding(s) in Static Analysis (SAST) — start with proc_freebsd.go (8), proc_windows.go (5), detect_darwin.go (4). — One of this dimension's main actionable groups (33 recommendation-level).
  2. Resolve the 6 High finding(s) in Static Analysis (SAST) — start with release.yml (6). — One of this dimension's main actionable groups (6 issue-level).

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

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

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

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

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

13 of 136 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/proc/linutil/regs_riscv64_arch.go.

Further orphaned files (smaller)

✓ On the Gold path — maintain.

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: client.go↔error_ids.go 79%; arm64_arch.go↔i386_arch.go 70%

Change coupling: client.go ↔ error_ids.go · ×2service/dap/daptest/client.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 & Signing2.5 / 10Weak✓ 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 2.5 / 10 · rule-coverage 100% · ceiling Documented

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

Unpinned build actions
PR-triggered workflow without a permissions block
No build provenance
No SBOM

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No build provenance 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.

D38 · OSV Dependency Vulnerabilities9.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

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

Medium CVE: GO-2025-3955go.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)4.5 / 10Weak✓ 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.

  • 77 code files changed in the last 6 months but the README was not touched — it may no longer reflect the system.

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • 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.
  • Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
  • Review the README against recent changes; refresh the parts that drifted.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

  • No Architecture Decision Records found — no conventional ADR directory, no `NNNN-title.md` documents and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree with `NNNN-title.md` names is the most discoverable form).
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 accuracy1.0 / 10Critical◐ 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.

  • README claims bugs-only GitHub tracker but the evidence shows a developer mailing list for feature proposals
  • README omits any mention of the Go reference (pkg.go.dev) badge and its link to github.com/go-delve/delve

What to do

  • Reconcile the README with reality: README claims bugs-only GitHub tracker but the evidence shows a developer mailing list for feature proposals; README omits any mention of the Go reference (pkg.go.dev) badge and its link to github.com/go-delve/delve.
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 tooling5.0 / 10Adequate✓ 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

  • Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene5.0 / 10Adequate✓ 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.

What to do

  • Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.

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 Health58%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture100%ExemplaryStrongest area.
Maturity47%Weak — gated by M4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness62%AdequateAcceptable, with room to improve.
Security57%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 71 check(s) not relevant to this codebase

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

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • 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 — ~30614 lines of test source are present (.go) 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)), 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.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .py) 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 — no ADRs to check
  • 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.
  • 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) — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
  • 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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, 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.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.go) 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); 2 value object(s)
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 CQRS handler(s); 1 event-sourced shape(s) (event folds / event-recording aggregates)
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this 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 · ×6
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:38 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:44 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/setup-go@<40-character SHA>`. This step references `actions/setup-go@v5`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v5 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:49 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: sigstore/cosign-installer@<40-character SHA>`. This step references `sigstore/cosign-installer@v3`; resolve the SHA it points at today with `gh api repos/sigstore/cosign-installer/commits/v3 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:53 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: goreleaser/goreleaser-action@<40-character SHA>`. This step references `goreleaser/goreleaser-action@v6`; resolve the SHA it points at today with `gh api repos/goreleaser/goreleaser-action/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:63 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: goreleaser/goreleaser-action@<40-character SHA>`. This step references `goreleaser/goreleaser-action@v6`; resolve the SHA it points at today with `gh api repos/goreleaser/goreleaser-action/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:72 — GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/upload-artifact@<40-character SHA>`. This step references `actions/upload-artifact@v4`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v4 --jq .sha`.
Warning — 481 finding(s)
D3 · God Classes · FileTooLong · ×19
  • FileTooLong: dap/server.go service/dap/server.go:0 — FileTooLong — 2828 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: terminal/command.go pkg/terminal/command.go:0 — FileTooLong — 2149 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/eval.go pkg/proc/eval.go:0 — FileTooLong — 2147 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/bininfo.go pkg/proc/bininfo.go:0 — FileTooLong — 1912 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: debugger/debugger.go service/debugger/debugger.go:0 — FileTooLong — 1718 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/variables.go pkg/proc/variables.go:0 — FileTooLong — 1502 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: gdbserial/gdbserver.go pkg/proc/gdbserial/gdbserver.go:0 — FileTooLong — 1277 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: gdbserial/gdbserver_conn.go pkg/proc/gdbserial/gdbserver_conn.go:0 — FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: cmds/commands.go cmd/dlv/cmds/commands.go:0 — FileTooLong — 840 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/fncall.go pkg/proc/fncall.go:0 — FileTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/stack.go pkg/proc/stack.go:0 — FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/breakpoints.go pkg/proc/breakpoints.go:0 — FileTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: proc/stack_sigtramp.go pkg/proc/stack_sigtramp.go:0 — FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: godwarf/type.go pkg/dwarf/godwarf/type.go:0 — FileTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: rpc2/server.go service/rpc2/server.go:0 — FileTooLong — 665 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: native/proc_linux.go pkg/proc/native/proc_linux.go:0 — FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: evalop/evalcompile.go pkg/proc/evalop/evalcompile.go:0 — FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: native/proc_windows.go pkg/proc/native/proc_windows.go:0 — FileTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: terminal/terminal.go pkg/terminal/terminal.go:0 — FileTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded). To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D3 · God Classes · TooManyMethods · ×14
  • TooManyMethods: Client service/dap/daptest/client.go:24 — TooManyMethods — 198 methods, declared across 2 files: daptest/resp.go (122), daptest/client.go (76). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Session service/dap/server.go:177 — TooManyMethods — 107 methods, declared across 2 files: dap/server.go (101), dap/command.go (6). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Debugger service/debugger/debugger.go:64 — TooManyMethods — 96 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RPCClient service/rpc2/client.go:21 — TooManyMethods — 89 methods. Most of these members implement service.Client (82 of 89 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: BinaryInfo pkg/proc/bininfo.go:53 — TooManyMethods — 60 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RPCServer service/rpc2/server.go:17 — TooManyMethods — 57 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: gdbProcess pkg/proc/gdbserial/gdbserver.go:144 — TooManyMethods — 46 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Variable pkg/proc/variables.go:103 — TooManyMethods — 45 methods, declared across 3 files: proc/variables.go (34), proc/eval.go (10), proc/mapiter.go (1). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: gdbConn pkg/proc/gdbserial/gdbserver_conn.go:23 — TooManyMethods — 44 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Target pkg/proc/target.go:39 — TooManyMethods — 38 methods, declared across 5 files: proc/target.go (21), proc/breakpoints.go (9), proc/dump.go (4), proc/stackwatch.go (2), +1 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: process pkg/proc/core/core.go:158 — TooManyMethods — 36 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Term pkg/terminal/terminal.go:57 — TooManyMethods — 33 methods, declared across 2 files: terminal/terminal.go (26), terminal/command.go (7). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: nativeProcess pkg/proc/native/proc.go:15 — TooManyMethods — 32 methods, declared across 6 files: native/proc.go (16), native/proc_linux.go (10), native/proc_windows.go (3), native/dump_linux.go (1), +2 more file(s). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TargetGroup pkg/proc/target_group.go:20 — TooManyMethods — 31 methods, declared across 3 files: proc/target_group.go (19), proc/target_exec.go (8), proc/target.go (4). That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D15 · Churn × Complexity Hotspots · Hotspot · ×8
  • Hotspot: service/dap/server.go service/dap/server.go — service/dap/server.go changed 7 times in last 90 days, max complexity 57. 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/proc/stack.go pkg/proc/stack.go — pkg/proc/stack.go changed 4 times in last 90 days, max complexity 39. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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: pkg/proc/eval.go pkg/proc/eval.go — pkg/proc/eval.go changed 2 times in last 90 days, max complexity 65. 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: service/debugger/debugger.go service/debugger/debugger.go — service/debugger/debugger.go changed 2 times in last 90 days, max complexity 55. 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/terminal/command.go pkg/terminal/command.go — pkg/terminal/command.go changed 3 times in last 90 days, max complexity 36. 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: pkg/proc/bininfo.go pkg/proc/bininfo.go — pkg/proc/bininfo.go changed 3 times in last 90 days, max complexity 36. 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: pkg/terminal/terminal.go pkg/terminal/terminal.go — pkg/terminal/terminal.go changed 2 times in last 90 days, max complexity 31. 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: service/dap/command.go service/dap/command.go — service/dap/command.go changed 2 times in last 90 days, max complexity 21. 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 (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) pkg/dwarf/godwarf/addr.go:25 — pkg/dwarf/godwarf/addr.go:25-36 | pkg/dwarf/loclist/dwarf5_loclist.go:27-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, 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/proc/dump.go:406 — pkg/proc/dump.go:406-417 | service/rpccommon/server.go:399-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/dump.go:406` it begins part-way through the construct above it, so those exact lines 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/proc/gdbserial/gdbserver_conn.go:1481 — pkg/proc/gdbserial/gdbserver_conn.go:1481-1492 | pkg/proc/gdbserial/gdbserver_conn.go:1528-1539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/gdbserial/gdbserver_conn.go:1481` it does not close everything it opens, so those exact lines 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/proc/gdbserial/rr.go:87 — pkg/proc/gdbserial/rr.go:87-98 | pkg/proc/native/proc.go:454-465 — 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 (12 lines × 2) pkg/proc/linutil/regs_loong64_arch.go:84 — pkg/proc/linutil/regs_loong64_arch.go:84-95 | pkg/proc/linutil/regs_riscv64_arch.go:111-122 — 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/proc/linutil/regs_loong64_arch.go:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) pkg/dwarf/parseutil.go:33 — pkg/dwarf/parseutil.go:33-43 | pkg/proc/linutil/dynamic.go:33-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dwarf/parseutil.go:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) pkg/proc/arm64_disasm.go:62 — pkg/proc/arm64_disasm.go:62-72 | pkg/proc/ppc64le_disasm.go:103-113 — 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/proc/arm64_disasm.go:62` it begins part-way through the construct above it, so those exact lines 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/proc/eval.go:3018 — pkg/proc/eval.go:3018-3028 | pkg/proc/variables.go:1145-1155 — 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/proc/eval.go:3018` it begins part-way through the construct above it, so those exact lines 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/proc/fbsdutil/regs.go:165 — pkg/proc/fbsdutil/regs.go:165-175 | pkg/proc/linutil/regs_amd64_arch.go:139-149 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×4
  • Duplicated block (10 lines × 2) pkg/proc/eval.go:3043 — pkg/proc/eval.go:3043-3052 | pkg/proc/variables.go:1165-1174 — 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/proc/eval.go:3043` it begins part-way through the construct above it, so those exact lines 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/proc/fbsdutil/regs.go:188 — pkg/proc/fbsdutil/regs.go:188-197 | pkg/proc/linutil/regs_amd64_arch.go:162-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/fbsdutil/regs.go:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pkg/proc/stack.go:681 — pkg/proc/stack.go:681-690 | pkg/proc/stack.go:734-750 — both copies are in the same file, so extract the 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 (10 lines × 2) pkg/proc/stack_sigtramp.go:356 — pkg/proc/stack_sigtramp.go:356-365 | pkg/proc/stack_sigtramp.go:436-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/stack_sigtramp.go:356` it begins part-way through the construct above it, so those 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 × 2) · ×4
  • Duplicated block (9 lines × 2) pkg/proc/eval.go:1628 — pkg/proc/eval.go:1628-1636 | pkg/proc/eval.go:1644-1652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/eval.go:1628` it does not close everything it opens, so those exact lines 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/proc/eval.go:1911 — pkg/proc/eval.go:1911-1919 | pkg/proc/eval.go:1944-1952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/eval.go:1911` it begins part-way through the construct above it, so those exact 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/proc/stack_sigtramp.go:538 — pkg/proc/stack_sigtramp.go:538-546 | pkg/proc/stack_sigtramp.go:824-832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/stack_sigtramp.go:538` it begins part-way through the construct above it, so those exact lines 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/proc/stack_sigtramp.go:645 — pkg/proc/stack_sigtramp.go:645-653 | pkg/proc/stack_sigtramp.go:705-713 — both copies are in the same file, so extract the 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 (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) pkg/proc/breakpoints.go:952 — pkg/proc/breakpoints.go:952-965 | pkg/proc/breakpoints.go:975-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/breakpoints.go:952` it begins part-way through the construct above it, so those exact 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/proc/gdbserial/gdbserver.go:1878 — pkg/proc/gdbserial/gdbserver.go:1878-1891 | pkg/proc/gdbserial/gdbserver.go:1931-1944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/gdbserial/gdbserver.go:1878` it begins part-way through the construct above it, so those exact 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/proc/gdbserial/rr.go:104 — pkg/proc/gdbserial/rr.go:104-117 | pkg/proc/native/proc.go:467-480 — 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/proc/gdbserial/rr.go:104` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) pkg/proc/evalop/evalcompile.go:747 — pkg/proc/evalop/evalcompile.go:747-753 | pkg/proc/evalop/evalcompile.go:777-783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/evalop/evalcompile.go:747` it does not close everything it opens, so those exact 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) service/api/prettyprint.go:386 — service/api/prettyprint.go:386-392 | service/api/prettyprint.go:486-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/api/prettyprint.go:386` it does not close everything it opens, so those 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/proc/stack_sigtramp.go:828 — pkg/proc/stack_sigtramp.go:828-834 | pkg/proc/stack_sigtramp.go:907-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D1 · Cyclomatic Complexity · AMD64Registers.SetReg (cyclomatic 27) · ×2
  • AMD64Registers.SetReg (cyclomatic 27) pkg/proc/fbsdutil/regs.go:186 — AMD64Registers.SetReg has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • AMD64Registers.SetReg (cyclomatic 27) pkg/proc/linutil/regs_amd64_arch.go:160 — AMD64Registers.SetReg has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: client.go ↔ error_ids.go service/dap/daptest/client.go — `service/dap/daptest/client.go` and `service/dap/error_ids.go` change together 79% of the time (19 of the 24 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.
  • Change coupling: arm64_arch.go ↔ i386_arch.go pkg/proc/arm64_arch.go — `pkg/proc/arm64_arch.go` and `pkg/proc/i386_arch.go` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) service/debugger/debugger.go:1354 — service/debugger/debugger.go:1354-1363 | service/debugger/debugger.go:1378-1387 | service/debugger/debugger.go:1615-1625 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (10 lines × 3) service/rpc2/server.go:178 — service/rpc2/server.go:178-187 | service/rpc2/server.go:318-327 | service/rpc2/server.go:350-359 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/rpc2/server.go:178` it begins part-way through the construct above it, so those 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 (8 lines × 2) · ×2
  • Duplicated block (8 lines × 2) pkg/proc/eval.go:1578 — pkg/proc/eval.go:1578-1585 | pkg/proc/eval.go:1605-1612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/eval.go:1578` it does not close everything it opens, so those exact lines 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/proc/gdbserial/gdbserver.go:1718 — pkg/proc/gdbserial/gdbserver.go:1718-1725 | pkg/proc/gdbserial/gdbserver.go:1738-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/gdbserial/gdbserver.go:1718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) pkg/proc/amd64_arch.go:358 — pkg/proc/amd64_arch.go:358-363 | pkg/proc/i386_arch.go:242-247 — 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/proc/amd64_arch.go:358` it begins part-way through the construct above it, so those exact lines 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/proc/dump.go:420 — pkg/proc/dump.go:420-425 | service/rpccommon/server.go:413-418 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) pkg/proc/eval.go:1683 — pkg/proc/eval.go:1683-1687 | pkg/proc/eval.go:1705-1709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/proc/eval.go:1683` it begins part-way through the construct above it, so those 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 (5 lines × 2) service/api/conversions.go:196 — service/api/conversions.go:196-200 | service/api/conversions.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 `service/api/conversions.go:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · godwarf.readType (cyclomatic 94) · ×1
  • godwarf.readType (cyclomatic 94) pkg/dwarf/godwarf/type.go:564 — godwarf.readType has cyclomatic complexity 94 (threshold 15). Of this number, 83 points are the body's own statements and 11 belong to 3 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · evalStack.executeOp (cyclomatic 65) · ×1
  • evalStack.executeOp (cyclomatic 65) pkg/proc/eval.go:1098 — evalStack.executeOp has cyclomatic complexity 65 (threshold 15). Of this number, 64 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 · EvalScope.evalTypeCast (cyclomatic 61) · ×1
  • EvalScope.evalTypeCast (cyclomatic 61) pkg/proc/eval.go:1517 — EvalScope.evalTypeCast 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 · compileCtx.compileAST (cyclomatic 61) · ×1
  • compileCtx.compileAST (cyclomatic 61) pkg/proc/evalop/evalcompile.go:293 — compileCtx.compileAST 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 · EvalScope.simpleLocals (cyclomatic 59) · ×1
  • EvalScope.simpleLocals (cyclomatic 59) pkg/proc/eval.go:419 — EvalScope.simpleLocals has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session.handleRequest (cyclomatic 57) · ×1
  • Session.handleRequest (cyclomatic 57) service/dap/server.go:702 — Session.handleRequest has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
D1 · Cyclomatic Complexity · Debugger.Command (cyclomatic 55) · ×1
  • Debugger.Command (cyclomatic 55) service/debugger/debugger.go:1088 — Debugger.Command has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · native.trapWaitInternal (cyclomatic 53) · ×1
  • native.trapWaitInternal (cyclomatic 53) pkg/proc/native/proc_linux.go:440 — native.trapWaitInternal has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session.onLaunchRequest (cyclomatic 53) · ×1
  • Session.onLaunchRequest (cyclomatic 53) service/dap/server.go:1045 — Session.onLaunchRequest has cyclomatic complexity 53 (threshold 15). Of this number, 44 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 · Variable.loadValueInternal (cyclomatic 46) · ×1
  • Variable.loadValueInternal (cyclomatic 46) pkg/proc/variables.go:1338 — Variable.loadValueInternal 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 · Session.convertVariableWithOpts (cyclomatic 46) · ×1
  • Session.convertVariableWithOpts (cyclomatic 46) service/dap/server.go:3117 — Session.convertVariableWithOpts has cyclomatic complexity 46 (threshold 15). Of this number, 44 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 · cmds.traceCmd (cyclomatic 45) · ×1
  • cmds.traceCmd (cyclomatic 45) cmd/dlv/cmds/commands.go:672 — cmds.traceCmd has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to one function literal inside it that branches (line 673). 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 · Variable.findStructMemberOrMethod (cyclomatic 45) · ×1
  • Variable.findStructMemberOrMethod (cyclomatic 45) pkg/proc/eval.go:3009 — Variable.findStructMemberOrMethod has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.arm64SwitchStack (cyclomatic 44) · ×1
  • proc.arm64SwitchStack (cyclomatic 44) pkg/proc/arm64_arch.go:146 — proc.arm64SwitchStack has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · processGroup.waitForDebugEvent (cyclomatic 42) · ×1
  • processGroup.waitForDebugEvent (cyclomatic 42) pkg/proc/native/proc_windows.go:345 — processGroup.waitForDebugEvent 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 · Variable.writeTo (cyclomatic 41) · ×1
  • Variable.writeTo (cyclomatic 41) service/api/prettyprint.go:94 — Variable.writeTo 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 · proc.rangeFuncStackTrace (cyclomatic 39) · ×1
  • proc.rangeFuncStackTrace (cyclomatic 39) pkg/proc/stack.go:1161 — proc.rangeFuncStackTrace has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 7 of the 39 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1224, 1197, 1189). 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 · RISCV64Registers.SetReg (cyclomatic 38) · ×1
  • RISCV64Registers.SetReg (cyclomatic 38) pkg/proc/linutil/regs_riscv64_arch.go:266 — RISCV64Registers.SetReg has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · goversion.Parse (cyclomatic 37) · ×1
  • goversion.Parse (cyclomatic 37) pkg/goversion/go_version.go:40 — goversion.Parse has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalScope.evalCallInjectionStart (cyclomatic 37) · ×1
  • EvalScope.evalCallInjectionStart (cyclomatic 37) pkg/proc/fncall.go:246 — EvalScope.evalCallInjectionStart has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.newVariable (cyclomatic 36) · ×1
  • proc.newVariable (cyclomatic 36) pkg/proc/variables.go:662 — proc.newVariable has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BinaryInfo.loadDebugInfoMaps (cyclomatic 36) · ×1
  • BinaryInfo.loadDebugInfoMaps (cyclomatic 36) pkg/proc/bininfo.go:2619 — BinaryInfo.loadDebugInfoMaps 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 · gdbConn.parseStopPacket (cyclomatic 36) · ×1
  • gdbConn.parseStopPacket (cyclomatic 36) pkg/proc/gdbserial/gdbserver_conn.go:759 — gdbConn.parseStopPacket has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body's own statements and 10 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 · mapIteratorSwiss.loadTypes (cyclomatic 36) · ×1
  • mapIteratorSwiss.loadTypes (cyclomatic 36) pkg/proc/mapiter.go:391 — mapIteratorSwiss.loadTypes 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 · terminal.setBreakpoint (cyclomatic 36) · ×1
  • terminal.setBreakpoint (cyclomatic 36) pkg/terminal/command.go:1845 — terminal.setBreakpoint has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Debugger.traverse (cyclomatic 36) · ×1
  • Debugger.traverse (cyclomatic 36) service/debugger/debugger.go:1408 — Debugger.traverse has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 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 · proc.funcCallStep (cyclomatic 35) · ×1
  • proc.funcCallStep (cyclomatic 35) pkg/proc/fncall.go:811 — proc.funcCallStep has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.breakpointConditionSatisfiable (cyclomatic 34) · ×1
  • proc.breakpointConditionSatisfiable (cyclomatic 34) pkg/proc/breakpoints.go:1243 — proc.breakpointConditionSatisfiable has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1301, 1269, 1260). 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 · gdbserial.LLDBLaunch (cyclomatic 34) · ×1
  • gdbserial.LLDBLaunch (cyclomatic 34) pkg/proc/gdbserial/gdbserver.go:462 — gdbserial.LLDBLaunch 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 · colorize.Print (cyclomatic 34) · ×1
  • colorize.Print (cyclomatic 34) pkg/terminal/colorize/colorize.go:30 — colorize.Print has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 97, 69, 155). 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 · debugger.guessSubstitutePath (cyclomatic 34) · ×1
  • debugger.guessSubstitutePath (cyclomatic 34) service/debugger/debugger.go:2657 — debugger.guessSubstitutePath has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 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 · proc.FindFileLocation (cyclomatic 33) · ×1
  • proc.FindFileLocation (cyclomatic 33) pkg/proc/bininfo.go:170 — proc.FindFileLocation has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.compareOp (cyclomatic 33) · ×1
  • proc.compareOp (cyclomatic 33) pkg/proc/eval.go:2603 — proc.compareOp 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 · api.shortenTypeEx (cyclomatic 33) · ×1
  • api.shortenTypeEx (cyclomatic 33) service/api/shorten_type.go:16 — api.shortenTypeEx 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 · BinaryInfo.loadDebugInfoMapsCompileUnit (cyclomatic 32) · ×1
  • BinaryInfo.loadDebugInfoMapsCompileUnit (cyclomatic 32) pkg/proc/bininfo.go:2801 — BinaryInfo.loadDebugInfoMapsCompileUnit 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 · cmds.execute (cyclomatic 31) · ×1
  • cmds.execute (cyclomatic 31) cmd/dlv/cmds/commands.go:1067 — cmds.execute 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 · proc.riscv64SwitchStack (cyclomatic 31) · ×1
  • proc.riscv64SwitchStack (cyclomatic 31) pkg/proc/riscv64_arch.go:138 — proc.riscv64SwitchStack 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 · Term.Run (cyclomatic 31) · ×1
  • Term.Run (cyclomatic 31) pkg/terminal/terminal.go:318 — Term.Run has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 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 · proc.amd64SwitchStack (cyclomatic 30) · ×1
  • proc.amd64SwitchStack (cyclomatic 30) pkg/proc/amd64_arch.go:136 — proc.amd64SwitchStack 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 · processGroup.stop (cyclomatic 30) · ×1
  • processGroup.stop (cyclomatic 30) pkg/proc/native/proc_linux.go:740 — processGroup.stop 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 · terminal.printTracepoint (cyclomatic 30) · ×1
  • terminal.printTracepoint (cyclomatic 30) pkg/terminal/command.go:2961 — terminal.printTracepoint 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 · Session.childrenToDAPVariables (cyclomatic 30) · ×1
  • Session.childrenToDAPVariables (cyclomatic 30) service/dap/server.go:2847 — Session.childrenToDAPVariables 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 · proc.typeCastCompatibleTypes (cyclomatic 29) · ×1
  • proc.typeCastCompatibleTypes (cyclomatic 29) pkg/proc/eval.go:1800 — proc.typeCastCompatibleTypes 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 · proc.loong64SwitchStack (cyclomatic 29) · ×1
  • proc.loong64SwitchStack (cyclomatic 29) pkg/proc/loong64_arch.go:119 — proc.loong64SwitchStack 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 · mapIteratorClassic.nextBucket (cyclomatic 29) · ×1
  • mapIteratorClassic.nextBucket (cyclomatic 29) pkg/proc/mapiter.go:131 — mapIteratorClassic.nextBucket 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 · Session.onThreadsRequest (cyclomatic 29) · ×1
  • Session.onThreadsRequest (cyclomatic 29) service/dap/server.go:2169 — Session.onThreadsRequest has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Debugger.CreateBreakpoint (cyclomatic 29) · ×1
  • Debugger.CreateBreakpoint (cyclomatic 29) service/debugger/debugger.go:695 — Debugger.CreateBreakpoint has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.ppc64leSwitchStack (cyclomatic 28) · ×1
  • proc.ppc64leSwitchStack (cyclomatic 28) pkg/proc/ppc64le_arch.go:105 — proc.ppc64leSwitchStack 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 · minidump.Open (cyclomatic 28) · ×1
  • minidump.Open (cyclomatic 28) pkg/proc/core/minidump/minidump.go:320 — minidump.Open 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 · Variable.parseG (cyclomatic 28) · ×1
  • Variable.parseG (cyclomatic 28) pkg/proc/variables.go:881 — Variable.parseG has cyclomatic complexity 28 (threshold 15). Of this number, 26 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 · BinaryInfo.openSeparateDebugInfo (cyclomatic 27) · ×1
  • BinaryInfo.openSeparateDebugInfo (cyclomatic 27) pkg/proc/bininfo.go:1574 — BinaryInfo.openSeparateDebugInfo has cyclomatic complexity 27 (threshold 15). Of this number, 22 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 · BreakpointState.checkCond (cyclomatic 27) · ×1
  • BreakpointState.checkCond (cyclomatic 27) pkg/proc/breakpoints.go:294 — BreakpointState.checkCond 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 · core.readNote (cyclomatic 27) · ×1
  • core.readNote (cyclomatic 27) pkg/proc/core/linux_core.go:299 — core.readNote 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 · EvalScope.evalBinary (cyclomatic 27) · ×1
  • EvalScope.evalBinary (cyclomatic 27) pkg/proc/eval.go:2491 — EvalScope.evalBinary 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 · stackIterator.Next (cyclomatic 27) · ×1
  • stackIterator.Next (cyclomatic 27) pkg/proc/stack.go:266 — stackIterator.Next 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 · Target.Dump (cyclomatic 27) · ×1
  • Target.Dump (cyclomatic 27) pkg/proc/dump.go:96 — Target.Dump has cyclomatic complexity 27 (threshold 15). Of this number, 23 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 · terminal.breakpoints (cyclomatic 27) · ×1
  • terminal.breakpoints (cyclomatic 27) pkg/terminal/command.go:1680 — terminal.breakpoints 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 · formReader.next (cyclomatic 26) · ×1
  • formReader.next (cyclomatic 26) pkg/dwarf/line/parse_util.go:85 — formReader.next 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 · starbind.unmarshalStarlarkValueIntl (cyclomatic 26) · ×1
  • starbind.unmarshalStarlarkValueIntl (cyclomatic 26) pkg/terminal/starbind/conv.go:623 — starbind.unmarshalStarlarkValueIntl has cyclomatic complexity 26 (threshold 15). Of this number, 24 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 · Session.onExceptionInfoRequest (cyclomatic 26) · ×1
  • Session.onExceptionInfoRequest (cyclomatic 26) service/dap/server.go:4106 — Session.onExceptionInfoRequest 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 · Session.runUntilStopAndNotify (cyclomatic 26) · ×1
  • Session.runUntilStopAndNotify (cyclomatic 26) service/dap/server.go:4409 — Session.runUntilStopAndNotify 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 · stackIterator.readSigtrampgoContext (cyclomatic 25) · ×1
  • stackIterator.readSigtrampgoContext (cyclomatic 25) pkg/proc/stack_sigtramp.go:15 — stackIterator.readSigtrampgoContext has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AMD64CONTEXT.SetReg (cyclomatic 25) · ×1
  • AMD64CONTEXT.SetReg (cyclomatic 25) pkg/proc/winutil/regs_amd64_arch.go:290 — AMD64CONTEXT.SetReg has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Env.interfaceToStarlarkValue (cyclomatic 25) · ×1
  • Env.interfaceToStarlarkValue (cyclomatic 25) pkg/terminal/starbind/conv.go:20 — Env.interfaceToStarlarkValue has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · BinaryInfo.macOSDebugFrameBugWorkaround (cyclomatic 24) · ×1
  • BinaryInfo.macOSDebugFrameBugWorkaround (cyclomatic 24) pkg/proc/bininfo.go:2230 — BinaryInfo.macOSDebugFrameBugWorkaround 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 · EvalScope.Locals (cyclomatic 24) · ×1
  • EvalScope.Locals (cyclomatic 24) pkg/proc/eval.go:325 — EvalScope.Locals has cyclomatic complexity 24 (threshold 15). Of this number, 20 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 · gdbProcess.ContinueOnce (cyclomatic 24) · ×1
  • gdbProcess.ContinueOnce (cyclomatic 24) pkg/proc/gdbserial/gdbserver.go:848 — gdbProcess.ContinueOnce 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 · gdbThread.reloadRegisters (cyclomatic 24) · ×1
  • gdbThread.reloadRegisters (cyclomatic 24) pkg/proc/gdbserial/gdbserver.go:1693 — gdbThread.reloadRegisters 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 · Target.SetWatchpoint (cyclomatic 24) · ×1
  • Target.SetWatchpoint (cyclomatic 24) pkg/proc/breakpoints.go:720 — Target.SetWatchpoint 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 · Target.setBreakpointInternal (cyclomatic 24) · ×1
  • Target.setBreakpointInternal (cyclomatic 24) pkg/proc/breakpoints.go:793 — Target.setBreakpointInternal has cyclomatic complexity 24 (threshold 15). Of this number, 13 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 · proc.i386SwitchStack (cyclomatic 23) · ×1
  • proc.i386SwitchStack (cyclomatic 23) pkg/proc/i386_arch.go:119 — proc.i386SwitchStack 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 · gdbRegisters.Slice (cyclomatic 23) · ×1
  • gdbRegisters.Slice (cyclomatic 23) pkg/proc/gdbserial/gdbserver.go:2148 — gdbRegisters.Slice 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 · native.stop1 (cyclomatic 23) · ×1
  • native.stop1 (cyclomatic 23) pkg/proc/native/proc_linux.go:838 — native.stop1 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 · Variable.isType (cyclomatic 23) · ×1
  • Variable.isType (cyclomatic 23) pkg/proc/eval.go:2764 — Variable.isType 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 · starbind.New (cyclomatic 23) · ×1
  • starbind.New (cyclomatic 23) pkg/terminal/starbind/starlark.go:69 — starbind.New has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 164, 85, 105, …). 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 · Env.variableValueToStarlarkValue (cyclomatic 23) · ×1
  • Env.variableValueToStarlarkValue (cyclomatic 23) pkg/terminal/starbind/conv.go:242 — Env.variableValueToStarlarkValue has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · api.ParseGoroutineArgs (cyclomatic 23) · ×1
  • api.ParseGoroutineArgs (cyclomatic 23) service/api/command.go:35 — api.ParseGoroutineArgs 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 · Debugger.collectBreakpointInformation (cyclomatic 23) · ×1
  • Debugger.collectBreakpointInformation (cyclomatic 23) service/debugger/debugger.go:1275 — Debugger.collectBreakpointInformation 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 · gdbConn.recv (cyclomatic 22) · ×1
  • gdbConn.recv (cyclomatic 22) pkg/proc/gdbserial/gdbserver_conn.go:1370 — gdbConn.recv 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 · mapIteratorSwiss.next (cyclomatic 22) · ×1
  • mapIteratorSwiss.next (cyclomatic 22) pkg/proc/mapiter.go:506 — mapIteratorSwiss.next 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 · Variable.structField (cyclomatic 22) · ×1
  • Variable.structField (cyclomatic 22) pkg/proc/variables.go:1136 — Variable.structField 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 · Term.handleExit (cyclomatic 22) · ×1
  • Term.handleExit (cyclomatic 22) pkg/terminal/terminal.go:544 — Term.handleExit 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 · Session.onAttachRequest (cyclomatic 22) · ×1
  • Session.onAttachRequest (cyclomatic 22) service/dap/server.go:2314 — Session.onAttachRequest 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 · op.PrettyPrint (cyclomatic 21) · ×1
  • op.PrettyPrint (cyclomatic 21) pkg/dwarf/op/op.go:108 — op.PrettyPrint 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 · proc.negotiateType (cyclomatic 21) · ×1
  • proc.negotiateType (cyclomatic 21) pkg/proc/eval.go:2427 — proc.negotiateType 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 · core.threadsFromDelveNotes (cyclomatic 21) · ×1
  • core.threadsFromDelveNotes (cyclomatic 21) pkg/proc/core/delve_core.go:30 — core.threadsFromDelveNotes has cyclomatic complexity 21 (threshold 15). Of this number, 16 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 · gdbProcess.handleThreadSignals (cyclomatic 21) · ×1
  • gdbProcess.handleThreadSignals (cyclomatic 21) pkg/proc/gdbserial/gdbserver.go:977 — gdbProcess.handleThreadSignals 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 · gdbThread.SetReg (cyclomatic 21) · ×1
  • gdbThread.SetReg (cyclomatic 21) pkg/proc/gdbserial/gdbserver.go:2074 — gdbThread.SetReg 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 · gdbConn.step (cyclomatic 21) · ×1
  • gdbConn.step (cyclomatic 21) pkg/proc/gdbserial/gdbserver_conn.go:610 — gdbConn.step 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 · stackIterator.advanceRegsDWARF (cyclomatic 21) · ×1
  • stackIterator.advanceRegsDWARF (cyclomatic 21) pkg/proc/stack.go:705 — stackIterator.advanceRegsDWARF 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 · Term.expandPrompt (cyclomatic 21) · ×1
  • Term.expandPrompt (cyclomatic 21) pkg/terminal/terminal.go:722 — Term.expandPrompt has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.ParseExamineMemoryArg (cyclomatic 21) · ×1
  • api.ParseExamineMemoryArg (cyclomatic 21) service/api/command.go:179 — api.ParseExamineMemoryArg 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session.targetCmd (cyclomatic 21) · ×1
  • Session.targetCmd (cyclomatic 21) service/dap/command.go:255 — Session.targetCmd 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 · Session.onEvaluateRequest (cyclomatic 21) · ×1
  • Session.onEvaluateRequest (cyclomatic 21) service/dap/server.go:3281 — Session.onEvaluateRequest 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 · EvalScope.setValue (cyclomatic 20) · ×1
  • EvalScope.setValue (cyclomatic 20) pkg/proc/eval.go:621 — EvalScope.setValue has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · processGroup.ContinueOnce (cyclomatic 20) · ×1
  • processGroup.ContinueOnce (cyclomatic 20) pkg/proc/native/proc.go:269 — processGroup.ContinueOnce has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TargetGroup.addTarget (cyclomatic 20) · ×1
  • TargetGroup.addTarget (cyclomatic 20) pkg/proc/target_group.go:112 — TargetGroup.addTarget has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Variable.mapIterator (cyclomatic 20) · ×1
  • Variable.mapIterator (cyclomatic 20) pkg/proc/mapiter.go:18 — Variable.mapIterator has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · terminal.parseStackArgs (cyclomatic 20) · ×1
  • terminal.parseStackArgs (cyclomatic 20) pkg/terminal/command.go:2451 — terminal.parseStackArgs has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · api.PrintStack (cyclomatic 20) · ×1
  • api.PrintStack (cyclomatic 20) service/api/prettyprint.go:600 — api.PrintStack has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cmds.New (cyclomatic 19) · ×1
  • cmds.New (cyclomatic 19) cmd/dlv/cmds/commands.go:121 — cmds.New has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 525, 188, …). 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 · EBPFContext.handleParamEvent (cyclomatic 19) · ×1
  • EBPFContext.handleParamEvent (cyclomatic 19) pkg/proc/internal/ebpf/helpers.go:409 — EBPFContext.handleParamEvent has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · nativeProcess.initialize (cyclomatic 19) · ×1
  • nativeProcess.initialize (cyclomatic 19) pkg/proc/native/proc.go:351 — nativeProcess.initialize has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · stackIterator.advanceRegs (cyclomatic 19) · ×1
  • stackIterator.advanceRegs (cyclomatic 19) pkg/proc/stack.go:568 — stackIterator.advanceRegs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Target.setStackWatchBreakpoints (cyclomatic 19) · ×1
  • Target.setStackWatchBreakpoints (cyclomatic 19) pkg/proc/stackwatch.go:28 — Target.setStackWatchBreakpoints has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · G.Labels (cyclomatic 19) · ×1
  • G.Labels (cyclomatic 19) pkg/proc/variables.go:566 — G.Labels has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal.printcontext (cyclomatic 19) · ×1
  • terminal.printcontext (cyclomatic 19) pkg/terminal/command.go:2719 — terminal.printcontext has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal.target (cyclomatic 19) · ×1
  • terminal.target (cyclomatic 19) pkg/terminal/command.go:3530 — terminal.target has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerImpl.serveJSONCodec (cyclomatic 19) · ×1
  • ServerImpl.serveJSONCodec (cyclomatic 19) service/rpccommon/server.go:199 — ServerImpl.serveJSONCodec has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 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 · NormalLocationSpec.Find (cyclomatic 18) · ×1
  • NormalLocationSpec.Find (cyclomatic 18) pkg/locspec/locations.go:381 — NormalLocationSpec.Find has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.GoroutinesInfo (cyclomatic 18) · ×1
  • proc.GoroutinesInfo (cyclomatic 18) pkg/proc/variables.go:316 — proc.GoroutinesInfo has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalScope.evalJump (cyclomatic 18) · ×1
  • EvalScope.evalJump (cyclomatic 18) pkg/proc/eval.go:1460 — EvalScope.evalJump has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalScope.evalIndex (cyclomatic 18) · ×1
  • EvalScope.evalIndex (cyclomatic 18) pkg/proc/eval.go:2161 — EvalScope.evalIndex has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gdbConn.handshake (cyclomatic 18) · ×1
  • gdbConn.handshake (cyclomatic 18) pkg/proc/gdbserial/gdbserver_conn.go:101 — gdbConn.handshake has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · stackIterator.tryFramePointerUnwind (cyclomatic 18) · ×1
  • stackIterator.tryFramePointerUnwind (cyclomatic 18) pkg/proc/stack.go:620 — stackIterator.tryFramePointerUnwind has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Variable.reslice (cyclomatic 18) · ×1
  • Variable.reslice (cyclomatic 18) pkg/proc/eval.go:2952 — Variable.reslice has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Debugger.Restart (cyclomatic 18) · ×1
  • Debugger.Restart (cyclomatic 18) service/debugger/debugger.go:492 — Debugger.Restart has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.ConfigureSetSimple (cyclomatic 17) · ×1
  • config.ConfigureSetSimple (cyclomatic 17) pkg/config/split.go:72 — config.ConfigureSetSimple has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). 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 · line.parseFileEntries5 (cyclomatic 17) · ×1
  • line.parseFileEntries5 (cyclomatic 17) pkg/dwarf/line/line_parser.go:289 — line.parseFileEntries5 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · logflags.Setup (cyclomatic 17) · ×1
  • logflags.Setup (cyclomatic 17) pkg/logflags/logflags.go:194 — logflags.Setup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Function.parse (cyclomatic 17) · ×1
  • Function.parse (cyclomatic 17) pkg/proc/bininfo.go:554 — Function.parse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · core.readLinuxOrPlatformIndependentCore (cyclomatic 17) · ×1
  • core.readLinuxOrPlatformIndependentCore (cyclomatic 17) pkg/proc/core/linux_core.go:111 — core.readLinuxOrPlatformIndependentCore has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SplicedMemory.Add (cyclomatic 17) · ×1
  • SplicedMemory.Add (cyclomatic 17) pkg/proc/core/core.go:43 — SplicedMemory.Add 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 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 · EvalScope.ChanGoroutines (cyclomatic 17) · ×1
  • EvalScope.ChanGoroutines (cyclomatic 17) pkg/proc/eval.go:240 — EvalScope.ChanGoroutines has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 274, 253, 264). 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 · compileCtx.compileTypeCastOrFuncCall (cyclomatic 17) · ×1
  • compileCtx.compileTypeCastOrFuncCall (cyclomatic 17) pkg/proc/evalop/evalcompile.go:495 — compileCtx.compileTypeCastOrFuncCall has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gdbConn.readRegisterInfo (cyclomatic 17) · ×1
  • gdbConn.readRegisterInfo (cyclomatic 17) pkg/proc/gdbserial/gdbserver_conn.go:287 — gdbConn.readRegisterInfo has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nativeProcess.SetUProbe (cyclomatic 17) · ×1
  • nativeProcess.SetUProbe (cyclomatic 17) pkg/proc/native/proc_linux.go:945 — nativeProcess.SetUProbe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · stackIterator.newStackframe (cyclomatic 17) · ×1
  • stackIterator.newStackframe (cyclomatic 17) pkg/proc/stack.go:388 — stackIterator.newStackframe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · stackIterator.executeFrameRegRule (cyclomatic 17) · ×1
  • stackIterator.executeFrameRegRule (cyclomatic 17) pkg/proc/stack.go:810 — stackIterator.executeFrameRegRule has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Target.shouldDumpMemory (cyclomatic 17) · ×1
  • Target.shouldDumpMemory (cyclomatic 17) pkg/proc/dump.go:354 — Target.shouldDumpMemory has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Variable.registerVariableTypeConv (cyclomatic 17) · ×1
  • Variable.registerVariableTypeConv (cyclomatic 17) pkg/proc/variables.go:2181 — Variable.registerVariableTypeConv has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · terminal.getLocation (cyclomatic 17) · ×1
  • terminal.getLocation (cyclomatic 17) pkg/terminal/command.go:2523 — terminal.getLocation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Variable.writeBasicType (cyclomatic 17) · ×1
  • Variable.writeBasicType (cyclomatic 17) service/api/prettyprint.go:217 — Variable.writeBasicType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · frame.parseCIE (cyclomatic 16) · ×1
  • frame.parseCIE (cyclomatic 16) pkg/dwarf/frame/parser.go:150 — frame.parseCIE has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StateMachine.PCToLine (cyclomatic 16) · ×1
  • StateMachine.PCToLine (cyclomatic 16) pkg/dwarf/line/state_machine.go:264 — StateMachine.PCToLine has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.loadBinaryInfoElf (cyclomatic 16) · ×1
  • proc.loadBinaryInfoElf (cyclomatic 16) pkg/proc/bininfo.go:1705 — proc.loadBinaryInfoElf has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.allPointers (cyclomatic 16) · ×1
  • proc.allPointers (cyclomatic 16) pkg/proc/fncall.go:735 — proc.allPointers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.resolveCallArgLOONG64 (cyclomatic 16) · ×1
  • proc.resolveCallArgLOONG64 (cyclomatic 16) pkg/proc/loong64_disasm.go:62 — proc.resolveCallArgLOONG64 has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · proc.FindGoroutine (cyclomatic 16) · ×1
  • proc.FindGoroutine (cyclomatic 16) pkg/proc/variables.go:383 — proc.FindGoroutine has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · proc.resolveCallArgX86 (cyclomatic 16) · ×1
  • proc.resolveCallArgX86 (cyclomatic 16) pkg/proc/x86_disasm.go:70 — proc.resolveCallArgX86 has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EvalScope.findGlobalInternal (cyclomatic 16) · ×1
  • EvalScope.findGlobalInternal (cyclomatic 16) pkg/proc/eval.go:812 — EvalScope.findGlobalInternal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · gdbProcess.updateThreadList (cyclomatic 16) · ×1
  • gdbProcess.updateThreadList (cyclomatic 16) pkg/proc/gdbserial/gdbserver.go:1420 — gdbProcess.updateThreadList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nativeProcess.MemoryMap (cyclomatic 16) · ×1
  • nativeProcess.MemoryMap (cyclomatic 16) pkg/proc/native/dump_linux.go:12 — nativeProcess.MemoryMap has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · nativeProcess.addThread (cyclomatic 16) · ×1
  • nativeProcess.addThread (cyclomatic 16) pkg/proc/native/proc_linux.go:344 — nativeProcess.addThread has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TargetGroup.enableBreakpoint (cyclomatic 16) · ×1
  • TargetGroup.enableBreakpoint (cyclomatic 16) pkg/proc/target_group.go:329 — TargetGroup.enableBreakpoint has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Variable.formatTime (cyclomatic 16) · ×1
  • Variable.formatTime (cyclomatic 16) pkg/proc/variables.go:2371 — Variable.formatTime has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal.whatisCommand (cyclomatic 16) · ×1
  • terminal.whatisCommand (cyclomatic 16) pkg/terminal/command.go:2200 — terminal.whatisCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal.printcontextThread (cyclomatic 16) · ×1
  • terminal.printcontextThread (cyclomatic 16) pkg/terminal/command.go:2806 — terminal.printcontextThread has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · terminal.New (cyclomatic 16) · ×1
  • terminal.New (cyclomatic 16) pkg/terminal/terminal.go:106 — terminal.New has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 140). 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 · Term.sigintGuard (cyclomatic 16) · ×1
  • Term.sigintGuard (cyclomatic 16) pkg/terminal/terminal.go:252 — Term.sigintGuard has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Session.onRestartRequest (cyclomatic 16) · ×1
  • Session.onRestartRequest (cyclomatic 16) service/dap/server.go:3480 — Session.onRestartRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · rpc2.MakeGuessSusbtitutePathIn (cyclomatic 16) · ×1
  • rpc2.MakeGuessSusbtitutePathIn (cyclomatic 16) service/rpc2/client.go:635 — rpc2.MakeGuessSusbtitutePathIn has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D2 · Cognitive Complexity · godwarf.readType (cognitive 164) · ×1
  • godwarf.readType (cognitive 164) pkg/dwarf/godwarf/type.go:564 — godwarf.readType has cognitive complexity 164 (threshold 15). Drivers by points: if/else 105, match/switch 33, jumps 12, loops 11, boolean chains 3 (nesting depth added 88). Of this number, 146 points are the body's own statements and 18 belong to 3 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · native.trapWaitInternal (cognitive 147) · ×1
  • native.trapWaitInternal (cognitive 147) pkg/proc/native/proc_linux.go:440 — native.trapWaitInternal has cognitive complexity 147 (threshold 15). Drivers by points: if/else 134, boolean chains 7, loops 6 (nesting depth added 93). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmds.traceCmd (cognitive 122) · ×1
  • cmds.traceCmd (cognitive 122) cmd/dlv/cmds/commands.go:672 — cmds.traceCmd has cognitive complexity 122 (threshold 15). Drivers by points: if/else 92, loops 21, boolean chains 5, match/switch 4 (nesting depth added 70). Most of this is not in the body itself: 0 of the 122 points are its own statements and the rest belongs to one function literal inside it that branches (line 673). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · processGroup.waitForDebugEvent (cognitive 109) · ×1
  • processGroup.waitForDebugEvent (cognitive 109) pkg/proc/native/proc_windows.go:345 — processGroup.waitForDebugEvent has cognitive complexity 109 (threshold 15). Drivers by points: if/else 95, loops 7, match/switch 5, boolean chains 2 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compileCtx.compileAST (cognitive 101) · ×1
  • compileCtx.compileAST (cognitive 101) pkg/proc/evalop/evalcompile.go:293 — compileCtx.compileAST has cognitive complexity 101 (threshold 15). Drivers by points: if/else 67, match/switch 23, boolean chains 8, loops 3 (nesting depth added 64). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Variable.findStructMemberOrMethod (cognitive 99) · ×1
  • Variable.findStructMemberOrMethod (cognitive 99) pkg/proc/eval.go:3009 — Variable.findStructMemberOrMethod has cognitive complexity 99 (threshold 15). Drivers by points: if/else 85, loops 6, boolean chains 5, match/switch 3 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.traverse (cognitive 98) · ×1
  • Debugger.traverse (cognitive 98) service/debugger/debugger.go:1408 — Debugger.traverse has cognitive complexity 98 (threshold 15). Drivers by points: if/else 78, loops 15, boolean chains 5 (nesting depth added 65). Of this number, 40 points are the body's own statements and 58 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.simpleLocals (cognitive 94) · ×1
  • EvalScope.simpleLocals (cognitive 94) pkg/proc/eval.go:419 — EvalScope.simpleLocals has cognitive complexity 94 (threshold 15). Drivers by points: if/else 70, boolean chains 16, loops 6, match/switch 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.evalTypeCast (cognitive 93) · ×1
  • EvalScope.evalTypeCast (cognitive 93) pkg/proc/eval.go:1517 — EvalScope.evalTypeCast has cognitive complexity 93 (threshold 15). Drivers by points: if/else 56, match/switch 19, loops 14, boolean chains 4 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onLaunchRequest (cognitive 84) · ×1
  • Session.onLaunchRequest (cognitive 84) service/dap/server.go:1045 — Session.onLaunchRequest has cognitive complexity 84 (threshold 15). Drivers by points: if/else 71, loops 6, boolean chains 4, match/switch 3 (nesting depth added 31). Of this number, 66 points are the body's own statements and 18 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.loadDebugInfoMaps (cognitive 83) · ×1
  • BinaryInfo.loadDebugInfoMaps (cognitive 83) pkg/proc/bininfo.go:2619 — BinaryInfo.loadDebugInfoMaps has cognitive complexity 83 (threshold 15). Drivers by points: if/else 69, loops 8, boolean chains 4, match/switch 2 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onThreadsRequest (cognitive 81) · ×1
  • Session.onThreadsRequest (cognitive 81) service/dap/server.go:2169 — Session.onThreadsRequest has cognitive complexity 81 (threshold 15). Drivers by points: if/else 62, loops 14, boolean chains 3, match/switch 2 (nesting depth added 49). Of this number, 74 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.loadDebugInfoMapsCompileUnit (cognitive 74) · ×1
  • BinaryInfo.loadDebugInfoMapsCompileUnit (cognitive 74) pkg/proc/bininfo.go:2801 — BinaryInfo.loadDebugInfoMapsCompileUnit has cognitive complexity 74 (threshold 15). Drivers by points: if/else 68, boolean chains 3, match/switch 2, loops 1 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · G.Labels (cognitive 74) · ×1
  • G.Labels (cognitive 74) pkg/proc/variables.go:566 — G.Labels has cognitive complexity 74 (threshold 15). Drivers by points: if/else 57, loops 11, match/switch 4, boolean chains 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.printTracepoint (cognitive 74) · ×1
  • terminal.printTracepoint (cognitive 74) pkg/terminal/command.go:2961 — terminal.printTracepoint has cognitive complexity 74 (threshold 15). Drivers by points: if/else 60, loops 9, boolean chains 5 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.convertVariableWithOpts (cognitive 68) · ×1
  • Session.convertVariableWithOpts (cognitive 68) service/dap/server.go:3117 — Session.convertVariableWithOpts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 61, boolean chains 6, match/switch 1 (nesting depth added 31). Of this number, 65 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debugger.guessSubstitutePath (cognitive 68) · ×1
  • debugger.guessSubstitutePath (cognitive 68) service/debugger/debugger.go:2657 — debugger.guessSubstitutePath has cognitive complexity 68 (threshold 15). Drivers by points: if/else 46, loops 16, boolean chains 6 (nesting depth added 35). Of this number, 61 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.Command (cognitive 68) · ×1
  • Debugger.Command (cognitive 68) service/debugger/debugger.go:1088 — Debugger.Command has cognitive complexity 68 (threshold 15). Drivers by points: if/else 58, loops 6, boolean chains 3, match/switch 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.arm64SwitchStack (cognitive 67) · ×1
  • proc.arm64SwitchStack (cognitive 67) pkg/proc/arm64_arch.go:146 — proc.arm64SwitchStack has cognitive complexity 67 (threshold 15). Drivers by points: if/else 57, boolean chains 8, match/switch 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.breakpoints (cognitive 67) · ×1
  • terminal.breakpoints (cognitive 67) pkg/terminal/command.go:1680 — terminal.breakpoints has cognitive complexity 67 (threshold 15). Drivers by points: if/else 58, loops 5, match/switch 3, jumps 1 (nesting depth added 38). Of this number, 65 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.writeTo (cognitive 67) · ×1
  • Variable.writeTo (cognitive 67) service/api/prettyprint.go:94 — Variable.writeTo has cognitive complexity 67 (threshold 15). Drivers by points: if/else 56, boolean chains 6, loops 4, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · processGroup.stop (cognitive 65) · ×1
  • processGroup.stop (cognitive 65) pkg/proc/native/proc_linux.go:740 — processGroup.stop has cognitive complexity 65 (threshold 15). Drivers by points: if/else 45, loops 19, boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.loadValueInternal (cognitive 64) · ×1
  • Variable.loadValueInternal (cognitive 64) pkg/proc/variables.go:1338 — Variable.loadValueInternal has cognitive complexity 64 (threshold 15). Drivers by points: if/else 50, boolean chains 6, match/switch 5, loops 3 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Term.Run (cognitive 62) · ×1
  • Term.Run (cognitive 62) pkg/terminal/terminal.go:318 — Term.Run has cognitive complexity 62 (threshold 15). Drivers by points: if/else 43, loops 17, boolean chains 1, match/switch 1 (nesting depth added 33). Of this number, 36 points are the body's own statements and 26 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · goversion.Parse (cognitive 61) · ×1
  • goversion.Parse (cognitive 61) pkg/goversion/go_version.go:40 — goversion.Parse has cognitive complexity 61 (threshold 15). Drivers by points: if/else 42, boolean chains 7, loops 7, match/switch 5 (nesting depth added 33). Of this number, 58 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbThread.reloadRegisters (cognitive 60) · ×1
  • gdbThread.reloadRegisters (cognitive 60) pkg/proc/gdbserial/gdbserver.go:1693 — gdbThread.reloadRegisters has cognitive complexity 60 (threshold 15). Drivers by points: if/else 35, loops 19, match/switch 4, boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.parseStopPacket (cognitive 60) · ×1
  • gdbConn.parseStopPacket (cognitive 60) pkg/proc/gdbserial/gdbserver_conn.go:759 — gdbConn.parseStopPacket has cognitive complexity 60 (threshold 15). Drivers by points: if/else 42, loops 8, match/switch 6, boolean chains 4 (nesting depth added 36). Of this number, 44 points are the body's own statements and 16 belong to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · mapIteratorSwiss.next (cognitive 59) · ×1
  • mapIteratorSwiss.next (cognitive 59) pkg/proc/mapiter.go:506 — mapIteratorSwiss.next has cognitive complexity 59 (threshold 15). Drivers by points: if/else 49, loops 6, boolean chains 4 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbserial.LLDBLaunch (cognitive 58) · ×1
  • gdbserial.LLDBLaunch (cognitive 58) pkg/proc/gdbserial/gdbserver.go:462 — gdbserial.LLDBLaunch has cognitive complexity 58 (threshold 15). Drivers by points: if/else 45, loops 9, boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.FindFileLocation (cognitive 57) · ×1
  • proc.FindFileLocation (cognitive 57) pkg/proc/bininfo.go:170 — proc.FindFileLocation has cognitive complexity 57 (threshold 15). Drivers by points: if/else 32, loops 18, boolean chains 7 (nesting depth added 27). Of this number, 51 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evalStack.executeOp (cognitive 57) · ×1
  • evalStack.executeOp (cognitive 57) pkg/proc/eval.go:1098 — evalStack.executeOp has cognitive complexity 57 (threshold 15). Drivers by points: if/else 52, boolean chains 2, loops 2, match/switch 1 (nesting depth added 27). Of this number, 56 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.funcCallStep (cognitive 56) · ×1
  • proc.funcCallStep (cognitive 56) pkg/proc/fncall.go:811 — proc.funcCallStep has cognitive complexity 56 (threshold 15). Drivers by points: if/else 46, loops 5, boolean chains 4, match/switch 1 (nesting depth added 26). Of this number, 51 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.childrenToDAPVariables (cognitive 56) · ×1
  • Session.childrenToDAPVariables (cognitive 56) service/dap/server.go:2847 — Session.childrenToDAPVariables has cognitive complexity 56 (threshold 15). Drivers by points: if/else 37, match/switch 7, boolean chains 6, loops 6 (nesting depth added 33). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Debugger.CreateBreakpoint (cognitive 55) · ×1
  • Debugger.CreateBreakpoint (cognitive 55) service/debugger/debugger.go:695 — Debugger.CreateBreakpoint has cognitive complexity 55 (threshold 15). Drivers by points: if/else 39, loops 13, boolean chains 1, jumps 1, match/switch 1 (nesting depth added 26). Of this number, 52 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.setBreakpoint (cognitive 54) · ×1
  • terminal.setBreakpoint (cognitive 54) pkg/terminal/command.go:1845 — terminal.setBreakpoint has cognitive complexity 54 (threshold 15). Drivers by points: if/else 41, loops 6, boolean chains 4, match/switch 3 (nesting depth added 21). Of this number, 47 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Term.handleExit (cognitive 52) · ×1
  • Term.handleExit (cognitive 52) pkg/terminal/terminal.go:544 — Term.handleExit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 51, boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.threadsFromDelveNotes (cognitive 49) · ×1
  • core.threadsFromDelveNotes (cognitive 49) pkg/proc/core/delve_core.go:30 — core.threadsFromDelveNotes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 37, loops 6, match/switch 4, boolean chains 2 (nesting depth added 30). Of this number, 40 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mapIteratorSwiss.loadTypes (cognitive 49) · ×1
  • mapIteratorSwiss.loadTypes (cognitive 49) pkg/proc/mapiter.go:391 — mapIteratorSwiss.loadTypes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24, match/switch 12, loops 8, boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native.stop1 (cognitive 49) · ×1
  • native.stop1 (cognitive 49) pkg/proc/native/proc_linux.go:838 — native.stop1 has cognitive complexity 49 (threshold 15). Drivers by points: if/else 40, loops 5, boolean chains 4 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.recv (cognitive 47) · ×1
  • gdbConn.recv (cognitive 47) pkg/proc/gdbserial/gdbserver_conn.go:1370 — gdbConn.recv has cognitive complexity 47 (threshold 15). Drivers by points: if/else 43, boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.shortenTypeEx (cognitive 47) · ×1
  • api.shortenTypeEx (cognitive 47) service/api/shorten_type.go:16 — api.shortenTypeEx has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29, loops 9, boolean chains 5, match/switch 4 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Session.runUntilStopAndNotify (cognitive 45) · ×1
  • Session.runUntilStopAndNotify (cognitive 45) service/dap/server.go:4409 — Session.runUntilStopAndNotify has cognitive complexity 45 (threshold 15). Drivers by points: if/else 36, match/switch 6, boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmds.execute (cognitive 44) · ×1
  • cmds.execute (cognitive 44) cmd/dlv/cmds/commands.go:1067 — cmds.execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 33, boolean chains 5, match/switch 4, loops 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.rangeFuncStackTrace (cognitive 44) · ×1
  • proc.rangeFuncStackTrace (cognitive 44) pkg/proc/stack.go:1161 — proc.rangeFuncStackTrace has cognitive complexity 44 (threshold 15). Drivers by points: if/else 35, boolean chains 7, loops 1, match/switch 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1224, 1197, 1189). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · BinaryInfo.openSeparateDebugInfo (cognitive 44) · ×1
  • BinaryInfo.openSeparateDebugInfo (cognitive 44) pkg/proc/bininfo.go:1574 — BinaryInfo.openSeparateDebugInfo has cognitive complexity 44 (threshold 15). Drivers by points: if/else 40, boolean chains 3, loops 1 (nesting depth added 18). Of this number, 37 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · colorize.Print (cognitive 44) · ×1
  • colorize.Print (cognitive 44) pkg/terminal/colorize/colorize.go:30 — colorize.Print has cognitive complexity 44 (threshold 15). Drivers by points: if/else 29, loops 10, boolean chains 4, match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 10 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 97, 69, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · minidump.Open (cognitive 43) · ×1
  • minidump.Open (cognitive 43) pkg/proc/core/minidump/minidump.go:320 — minidump.Open has cognitive complexity 43 (threshold 15). Drivers by points: if/else 31, loops 10, match/switch 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.targetCmd (cognitive 43) · ×1
  • Session.targetCmd (cognitive 43) service/dap/command.go:255 — Session.targetCmd has cognitive complexity 43 (threshold 15). Drivers by points: if/else 35, loops 4, match/switch 3, boolean chains 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · EvalScope.evalCallInjectionStart (cognitive 42) · ×1
  • EvalScope.evalCallInjectionStart (cognitive 42) pkg/proc/fncall.go:246 — EvalScope.evalCallInjectionStart has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, boolean chains 3, match/switch 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerImpl.serveJSONCodec (cognitive 42) · ×1
  • ServerImpl.serveJSONCodec (cognitive 42) service/rpccommon/server.go:199 — ServerImpl.serveJSONCodec has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39, boolean chains 2, loops 1 (nesting depth added 22). Of this number, 34 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.parseG (cognitive 41) · ×1
  • Variable.parseG (cognitive 41) pkg/proc/variables.go:881 — Variable.parseG has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, boolean chains 7, loops 1 (nesting depth added 7). Of this number, 39 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · proc.riscv64SwitchStack (cognitive 40) · ×1
  • proc.riscv64SwitchStack (cognitive 40) pkg/proc/riscv64_arch.go:138 — proc.riscv64SwitchStack has cognitive complexity 40 (threshold 15). Drivers by points: if/else 33, boolean chains 6, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · processGroup.ContinueOnce (cognitive 40) · ×1
  • processGroup.ContinueOnce (cognitive 40) pkg/proc/native/proc.go:269 — processGroup.ContinueOnce has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24, loops 14, boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.amd64SwitchStack (cognitive 38) · ×1
  • proc.amd64SwitchStack (cognitive 38) pkg/proc/amd64_arch.go:136 — proc.amd64SwitchStack has cognitive complexity 38 (threshold 15). Drivers by points: if/else 30, boolean chains 7, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbProcess.ContinueOnce (cognitive 38) · ×1
  • gdbProcess.ContinueOnce (cognitive 38) pkg/proc/gdbserial/gdbserver.go:848 — gdbProcess.ContinueOnce has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, loops 4, boolean chains 2, jumps 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackIterator.advanceRegsDWARF (cognitive 38) · ×1
  • stackIterator.advanceRegsDWARF (cognitive 38) pkg/proc/stack.go:705 — stackIterator.advanceRegsDWARF has cognitive complexity 38 (threshold 15). Drivers by points: if/else 34, boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.ParseExamineMemoryArg (cognitive 38) · ×1
  • api.ParseExamineMemoryArg (cognitive 38) service/api/command.go:179 — api.ParseExamineMemoryArg has cognitive complexity 38 (threshold 15). Drivers by points: if/else 29, jumps 3, boolean chains 2, loops 2, match/switch 2 (nesting depth added 19). Of this number, 35 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onEvaluateRequest (cognitive 38) · ×1
  • Session.onEvaluateRequest (cognitive 38) service/dap/server.go:3281 — Session.onEvaluateRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 28, boolean chains 5, loops 3, match/switch 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.ppc64leSwitchStack (cognitive 37) · ×1
  • proc.ppc64leSwitchStack (cognitive 37) pkg/proc/ppc64le_arch.go:105 — proc.ppc64leSwitchStack has cognitive complexity 37 (threshold 15). Drivers by points: if/else 31, boolean chains 3, match/switch 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · starbind.unmarshalStarlarkValueIntl (cognitive 37) · ×1
  • starbind.unmarshalStarlarkValueIntl (cognitive 37) pkg/terminal/starbind/conv.go:623 — starbind.unmarshalStarlarkValueIntl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 29, loops 5, match/switch 3 (nesting depth added 19). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.typeCastCompatibleTypes (cognitive 36) · ×1
  • proc.typeCastCompatibleTypes (cognitive 36) pkg/proc/eval.go:1800 — proc.typeCastCompatibleTypes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, loops 3, boolean chains 2, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BreakpointState.checkCond (cognitive 36) · ×1
  • BreakpointState.checkCond (cognitive 36) pkg/proc/breakpoints.go:294 — BreakpointState.checkCond has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 4, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.evalBinary (cognitive 36) · ×1
  • EvalScope.evalBinary (cognitive 36) pkg/proc/eval.go:2491 — EvalScope.evalBinary has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, boolean chains 3, match/switch 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.structField (cognitive 36) · ×1
  • Variable.structField (cognitive 36) pkg/proc/variables.go:1136 — Variable.structField has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 3, loops 3, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Term.sigintGuard (cognitive 36) · ×1
  • Term.sigintGuard (cognitive 36) pkg/terminal/terminal.go:252 — Term.sigintGuard has cognitive complexity 36 (threshold 15). Drivers by points: if/else 30, match/switch 3, boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.setBreakpoints (cognitive 36) · ×1
  • Session.setBreakpoints (cognitive 36) service/dap/server.go:1710 — Session.setBreakpoints has cognitive complexity 36 (threshold 15). Drivers by points: if/else 32, boolean chains 2, loops 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onExceptionInfoRequest (cognitive 36) · ×1
  • Session.onExceptionInfoRequest (cognitive 36) service/dap/server.go:4106 — Session.onExceptionInfoRequest has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 5, match/switch 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mapIteratorClassic.nextBucket (cognitive 35) · ×1
  • mapIteratorClassic.nextBucket (cognitive 35) pkg/proc/mapiter.go:131 — mapIteratorClassic.nextBucket has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25, boolean chains 5, loops 3, match/switch 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackIterator.Next (cognitive 35) · ×1
  • stackIterator.Next (cognitive 35) pkg/proc/stack.go:266 — stackIterator.Next has cognitive complexity 35 (threshold 15). Drivers by points: if/else 25, boolean chains 8, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · locspec.SubstitutePath (cognitive 34) · ×1
  • locspec.SubstitutePath (cognitive 34) pkg/locspec/locations.go:562 — locspec.SubstitutePath has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, loops 3, boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.compareOp (cognitive 34) · ×1
  • proc.compareOp (cognitive 34) pkg/proc/eval.go:2603 — proc.compareOp has cognitive complexity 34 (threshold 15). Drivers by points: if/else 21, match/switch 9, boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.parseStackArgs (cognitive 34) · ×1
  • terminal.parseStackArgs (cognitive 34) pkg/terminal/command.go:2451 — terminal.parseStackArgs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24, match/switch 7, loops 2, boolean chains 1 (nesting depth added 22). Of this number, 28 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.loong64SwitchStack (cognitive 33) · ×1
  • proc.loong64SwitchStack (cognitive 33) pkg/proc/loong64_arch.go:119 — proc.loong64SwitchStack has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, boolean chains 7, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.macOSDebugFrameBugWorkaround (cognitive 33) · ×1
  • BinaryInfo.macOSDebugFrameBugWorkaround (cognitive 33) pkg/proc/bininfo.go:2230 — BinaryInfo.macOSDebugFrameBugWorkaround has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24, loops 5, boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.handshake (cognitive 33) · ×1
  • gdbConn.handshake (cognitive 33) pkg/proc/gdbserial/gdbserver_conn.go:101 — gdbConn.handshake has cognitive complexity 33 (threshold 15). Drivers by points: if/else 31, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.step (cognitive 33) · ×1
  • gdbConn.step (cognitive 33) pkg/proc/gdbserial/gdbserver_conn.go:610 — gdbConn.step has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, match/switch 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TargetGroup.addTarget (cognitive 33) · ×1
  • TargetGroup.addTarget (cognitive 33) pkg/proc/target_group.go:112 — TargetGroup.addTarget has cognitive complexity 33 (threshold 15). Drivers by points: if/else 29, boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.target (cognitive 33) · ×1
  • terminal.target (cognitive 33) pkg/terminal/command.go:3530 — terminal.target has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 4, match/switch 3 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · gdbRegisters.Slice (cognitive 32) · ×1
  • gdbRegisters.Slice (cognitive 32) pkg/proc/gdbserial/gdbserver.go:2148 — gdbRegisters.Slice has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, boolean chains 4, loops 4, match/switch 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.readRegisterInfo (cognitive 32) · ×1
  • gdbConn.readRegisterInfo (cognitive 32) pkg/proc/gdbserial/gdbserver_conn.go:287 — gdbConn.readRegisterInfo has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24, match/switch 4, loops 3, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackIterator.advanceRegs (cognitive 32) · ×1
  • stackIterator.advanceRegs (cognitive 32) pkg/proc/stack.go:568 — stackIterator.advanceRegs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 23, boolean chains 7, match/switch 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Defer.load (cognitive 32) · ×1
  • Defer.load (cognitive 32) pkg/proc/stack.go:952 — Defer.load has cognitive complexity 32 (threshold 15). Drivers by points: if/else 26, loops 6 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Term.expandPrompt (cognitive 32) · ×1
  • Term.expandPrompt (cognitive 32) pkg/terminal/terminal.go:722 — Term.expandPrompt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 22, loops 6, match/switch 3, boolean chains 1 (nesting depth added 17). Of this number, 26 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.setBreakpointInternal (cognitive 31) · ×1
  • Target.setBreakpointInternal (cognitive 31) pkg/proc/breakpoints.go:793 — Target.setBreakpointInternal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, boolean chains 4, loops 4 (nesting depth added 8). Of this number, 20 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · starbind.New (cognitive 31) · ×1
  • starbind.New (cognitive 31) pkg/terminal/starbind/starlark.go:69 — starbind.New has cognitive complexity 31 (threshold 15). Drivers by points: if/else 19, match/switch 6, loops 5, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 0 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 164, 85, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · core.readNote (cognitive 30) · ×1
  • core.readNote (cognitive 30) pkg/proc/core/linux_core.go:299 — core.readNote has cognitive complexity 30 (threshold 15). Drivers by points: if/else 25, match/switch 3, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Commands.help (cognitive 30) · ×1
  • Commands.help (cognitive 30) pkg/terminal/command.go:760 — Commands.help has cognitive complexity 30 (threshold 15). Drivers by points: if/else 24, loops 5, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.ParseGoroutineArgs (cognitive 30) · ×1
  • api.ParseGoroutineArgs (cognitive 30) service/api/command.go:35 — api.ParseGoroutineArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, match/switch 2, boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.collectBreakpointInformation (cognitive 30) · ×1
  • Debugger.collectBreakpointInformation (cognitive 30) service/debugger/debugger.go:1275 — Debugger.collectBreakpointInformation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26, boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.Locals (cognitive 29) · ×1
  • EvalScope.Locals (cognitive 29) pkg/proc/eval.go:325 — EvalScope.Locals has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, boolean chains 5, loops 4 (nesting depth added 7). Of this number, 24 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.findGlobalInternal (cognitive 29) · ×1
  • EvalScope.findGlobalInternal (cognitive 29) pkg/proc/eval.go:812 — EvalScope.findGlobalInternal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17, loops 5, match/switch 4, boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.evalIndex (cognitive 29) · ×1
  • EvalScope.evalIndex (cognitive 29) pkg/proc/eval.go:2161 — EvalScope.evalIndex has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.Dump (cognitive 29) · ×1
  • Target.Dump (cognitive 29) pkg/proc/dump.go:96 — Target.Dump has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 4, match/switch 2, boolean chains 1 (nesting depth added 9). Of this number, 25 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.setStackWatchBreakpoints (cognitive 29) · ×1
  • Target.setStackWatchBreakpoints (cognitive 29) pkg/proc/stackwatch.go:28 — Target.setStackWatchBreakpoints has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, boolean chains 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.getLocation (cognitive 29) · ×1
  • terminal.getLocation (cognitive 29) pkg/terminal/command.go:2523 — terminal.getLocation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · terminal.printcontext (cognitive 29) · ×1
  • terminal.printcontext (cognitive 29) pkg/terminal/command.go:2719 — terminal.printcontext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22, loops 6, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Commands.goroutines (cognitive 29) · ×1
  • Commands.goroutines (cognitive 29) pkg/terminal/command.go:902 — Commands.goroutines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24, loops 4, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.ConfigureSetSimple (cognitive 28) · ×1
  • config.ConfigureSetSimple (cognitive 28) pkg/config/split.go:72 — config.ConfigureSetSimple has cognitive complexity 28 (threshold 15). Drivers by points: if/else 26, boolean chains 1, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · line.parseIncludeDirs5 (cognitive 28) · ×1
  • line.parseIncludeDirs5 (cognitive 28) pkg/dwarf/line/line_parser.go:177 — line.parseIncludeDirs5 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, match/switch 7, loops 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NormalLocationSpec.Find (cognitive 28) · ×1
  • NormalLocationSpec.Find (cognitive 28) pkg/locspec/locations.go:381 — NormalLocationSpec.Find has cognitive complexity 28 (threshold 15). Drivers by points: if/else 24, boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.breakpointConditionSatisfiable (cognitive 28) · ×1
  • proc.breakpointConditionSatisfiable (cognitive 28) pkg/proc/breakpoints.go:1243 — proc.breakpointConditionSatisfiable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16, boolean chains 7, match/switch 5 (nesting depth added 5). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1301, 1269, 1260). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · proc.i386SwitchStack (cognitive 28) · ×1
  • proc.i386SwitchStack (cognitive 28) pkg/proc/i386_arch.go:119 — proc.i386SwitchStack has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 5, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbProcess.updateThreadList (cognitive 28) · ×1
  • gdbProcess.updateThreadList (cognitive 28) pkg/proc/gdbserial/gdbserver.go:1420 — gdbProcess.updateThreadList has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, boolean chains 3, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbThread.SetReg (cognitive 28) · ×1
  • gdbThread.SetReg (cognitive 28) pkg/proc/gdbserial/gdbserver.go:2074 — gdbThread.SetReg has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · api.PrintStack (cognitive 28) · ×1
  • api.PrintStack (cognitive 28) service/api/prettyprint.go:600 — api.PrintStack has cognitive complexity 28 (threshold 15). Drivers by points: if/else 18, loops 8, boolean chains 2 (nesting depth added 10). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onAttachRequest (cognitive 28) · ×1
  • Session.onAttachRequest (cognitive 28) service/dap/server.go:2314 — Session.onAttachRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 23, boolean chains 2, loops 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debugger.attachErrorMessageLinux (cognitive 28) · ×1
  • debugger.attachErrorMessageLinux (cognitive 28) service/debugger/debugger_linux.go:18 — debugger.attachErrorMessageLinux has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22, loops 3, match/switch 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · line.parseFileEntries5 (cognitive 27) · ×1
  • line.parseFileEntries5 (cognitive 27) pkg/dwarf/line/line_parser.go:289 — line.parseFileEntries5 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16, match/switch 7, loops 3, boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.newCompositeMemory (cognitive 27) · ×1
  • proc.newCompositeMemory (cognitive 27) pkg/proc/mem.go:131 — proc.newCompositeMemory has cognitive complexity 27 (threshold 15). Drivers by points: if/else 21, boolean chains 3, match/switch 2, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.newVariable (cognitive 27) · ×1
  • proc.newVariable (cognitive 27) pkg/proc/variables.go:662 — proc.newVariable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20, match/switch 5, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeProcess.MemoryMap (cognitive 27) · ×1
  • nativeProcess.MemoryMap (cognitive 27) pkg/proc/native/dump_linux.go:12 — nativeProcess.MemoryMap has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, loops 5, jumps 3, match/switch 3, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StateMachine.PCToLine (cognitive 26) · ×1
  • StateMachine.PCToLine (cognitive 26) pkg/dwarf/line/state_machine.go:264 — StateMachine.PCToLine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · op.PrettyPrint (cognitive 26) · ×1
  • op.PrettyPrint (cognitive 26) pkg/dwarf/op/op.go:108 — op.PrettyPrint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16, boolean chains 4, loops 3, match/switch 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.negotiateType (cognitive 26) · ×1
  • proc.negotiateType (cognitive 26) pkg/proc/eval.go:2427 — proc.negotiateType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18, boolean chains 6, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.GoroutinesInfo (cognitive 26) · ×1
  • proc.GoroutinesInfo (cognitive 26) pkg/proc/variables.go:316 — proc.GoroutinesInfo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbProcess.handleThreadSignals (cognitive 26) · ×1
  • gdbProcess.handleThreadSignals (cognitive 26) pkg/proc/gdbserial/gdbserver.go:977 — gdbProcess.handleThreadSignals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, boolean chains 4, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · processGroup.resume (cognitive 26) · ×1
  • processGroup.resume (cognitive 26) pkg/proc/native/proc_linux.go:712 — processGroup.resume has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17, loops 8, boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TargetGroup.enableBreakpoint (cognitive 26) · ×1
  • TargetGroup.enableBreakpoint (cognitive 26) pkg/proc/target_group.go:329 — TargetGroup.enableBreakpoint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 2, match/switch 2, jumps 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rpc2.MakeGuessSusbtitutePathIn (cognitive 26) · ×1
  • rpc2.MakeGuessSusbtitutePathIn (cognitive 26) service/rpc2/client.go:635 — rpc2.MakeGuessSusbtitutePathIn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 19, loops 5, boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Reader.FindEntryNamed (cognitive 25) · ×1
  • Reader.FindEntryNamed (cognitive 25) pkg/dwarf/reader/reader.go:136 — Reader.FindEntryNamed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22, boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onRestartRequest (cognitive 25) · ×1
  • Session.onRestartRequest (cognitive 25) service/dap/server.go:3480 — Session.onRestartRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 24, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · frame.parseCIE (cognitive 24) · ×1
  • frame.parseCIE (cognitive 24) pkg/dwarf/frame/parser.go:150 — frame.parseCIE has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, boolean chains 3, match/switch 3, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.loadBinaryInfoElf (cognitive 24) · ×1
  • proc.loadBinaryInfoElf (cognitive 24) pkg/proc/bininfo.go:1705 — proc.loadBinaryInfoElf has cognitive complexity 24 (threshold 15). Drivers by points: if/else 24 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.loadDebugInfoMapsInlinedCalls (cognitive 24) · ×1
  • BinaryInfo.loadDebugInfoMapsInlinedCalls (cognitive 24) pkg/proc/bininfo.go:3017 — BinaryInfo.loadDebugInfoMapsInlinedCalls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20, match/switch 2, boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.ChanGoroutines (cognitive 24) · ×1
  • EvalScope.ChanGoroutines (cognitive 24) pkg/proc/eval.go:240 — EvalScope.ChanGoroutines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, loops 2 (nesting depth added 7). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 274, 253, 264). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · evalStack.run (cognitive 24) · ×1
  • evalStack.run (cognitive 24) pkg/proc/eval.go:1018 — evalStack.run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, match/switch 4, boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeProcess.addThread (cognitive 24) · ×1
  • nativeProcess.addThread (cognitive 24) pkg/proc/native/proc_linux.go:344 — nativeProcess.addThread has cognitive complexity 24 (threshold 15). Drivers by points: if/else 22, boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackIterator.readSigtrampgoContext (cognitive 24) · ×1
  • stackIterator.readSigtrampgoContext (cognitive 24) pkg/proc/stack_sigtramp.go:15 — stackIterator.readSigtrampgoContext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, match/switch 7, loops 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.isType (cognitive 24) · ×1
  • Variable.isType (cognitive 24) pkg/proc/eval.go:2764 — Variable.isType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18, boolean chains 3, match/switch 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.resolveCallArgLOONG64 (cognitive 23) · ×1
  • proc.resolveCallArgLOONG64 (cognitive 23) pkg/proc/loong64_disasm.go:62 — proc.resolveCallArgLOONG64 has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 12, if/else 9, boolean chains 2 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Function.parse (cognitive 23) · ×1
  • Function.parse (cognitive 23) pkg/proc/bininfo.go:554 — Function.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14, match/switch 6, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.readLinuxOrPlatformIndependentCore (cognitive 23) · ×1
  • core.readLinuxOrPlatformIndependentCore (cognitive 23) pkg/proc/core/linux_core.go:111 — core.readLinuxOrPlatformIndependentCore has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbProcess.initialize (cognitive 23) · ×1
  • gdbProcess.initialize (cognitive 23) pkg/proc/gdbserial/gdbserver.go:701 — gdbProcess.initialize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compositeMemory.WriteMemory (cognitive 23) · ×1
  • compositeMemory.WriteMemory (cognitive 23) pkg/proc/mem.go:186 — compositeMemory.WriteMemory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 3, match/switch 3, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.SetWatchpoint (cognitive 23) · ×1
  • Target.SetWatchpoint (cognitive 23) pkg/proc/breakpoints.go:720 — Target.SetWatchpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · terminal.whatisCommand (cognitive 23) · ×1
  • terminal.whatisCommand (cognitive 23) pkg/terminal/command.go:2200 — terminal.whatisCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, loops 6, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debugger.New (cognitive 23) · ×1
  • debugger.New (cognitive 23) service/debugger/debugger.go:167 — debugger.New has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, match/switch 3, boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.Restart (cognitive 23) · ×1
  • Debugger.Restart (cognitive 23) service/debugger/debugger.go:492 — Debugger.Restart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 3, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.FindGoroutine (cognitive 22) · ×1
  • proc.FindGoroutine (cognitive 22) pkg/proc/variables.go:383 — proc.FindGoroutine has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbserial.LLDBAttach (cognitive 22) · ×1
  • gdbserial.LLDBAttach (cognitive 22) pkg/proc/gdbserial/gdbserver.go:600 — gdbserial.LLDBAttach has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbThread.SetCurrentBreakpoint (cognitive 22) · ×1
  • gdbThread.SetCurrentBreakpoint (cognitive 22) pkg/proc/gdbserial/gdbserver.go:1964 — gdbThread.SetCurrentBreakpoint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17, boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EBPFContext.handleParamEvent (cognitive 22) · ×1
  • EBPFContext.handleParamEvent (cognitive 22) pkg/proc/internal/ebpf/helpers.go:409 — EBPFContext.handleParamEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, match/switch 2, boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · lineWriter.Write (cognitive 22) · ×1
  • lineWriter.Write (cognitive 22) pkg/terminal/colorize/colorize.go:280 — lineWriter.Write has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, match/switch 2, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.New (cognitive 22) · ×1
  • terminal.New (cognitive 22) pkg/terminal/terminal.go:106 — terminal.New has cognitive complexity 22 (threshold 15). Drivers by points: if/else 19, match/switch 2, boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 140). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Variable.writeBasicType (cognitive 22) · ×1
  • Variable.writeBasicType (cognitive 22) service/api/prettyprint.go:217 — Variable.writeBasicType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dap.parseLogPoint (cognitive 22) · ×1
  • dap.parseLogPoint (cognitive 22) service/dap/server.go:4719 — dap.parseLogPoint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, match/switch 5, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmds.New (cognitive 21) · ×1
  • cmds.New (cognitive 21) cmd/dlv/cmds/commands.go:121 — cmds.New has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 525, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · formReader.next (cognitive 21) · ×1
  • formReader.next (cognitive 21) pkg/dwarf/line/parse_util.go:85 — formReader.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NormalLocationSpec.findFuncCandidates (cognitive 21) · ×1
  • NormalLocationSpec.findFuncCandidates (cognitive 21) pkg/locspec/locations.go:445 — NormalLocationSpec.findFuncCandidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbserial.wiredecode (cognitive 21) · ×1
  • gdbserial.wiredecode (cognitive 21) pkg/proc/gdbserial/gdbserver_conn.go:1480 — gdbserial.wiredecode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, loops 5, match/switch 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeProcess.DumpProcessNotes (cognitive 21) · ×1
  • nativeProcess.DumpProcessNotes (cognitive 21) pkg/proc/native/dump_linux_amd64.go:31 — nativeProcess.DumpProcessNotes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeProcess.SetUProbe (cognitive 21) · ×1
  • nativeProcess.SetUProbe (cognitive 21) pkg/proc/native/proc_linux.go:945 — nativeProcess.SetUProbe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stackIterator.newStackframe (cognitive 21) · ×1
  • stackIterator.newStackframe (cognitive 21) pkg/proc/stack.go:388 — stackIterator.newStackframe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16, boolean chains 3, match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.setEBPFTracepointOnFunc (cognitive 21) · ×1
  • Target.setEBPFTracepointOnFunc (cognitive 21) pkg/proc/breakpoints.go:611 — Target.setEBPFTracepointOnFunc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.loadSliceInfo (cognitive 21) · ×1
  • Variable.loadSliceInfo (cognitive 21) pkg/proc/variables.go:1615 — Variable.loadSliceInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, match/switch 2, boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.examineMemoryCmd (cognitive 21) · ×1
  • terminal.examineMemoryCmd (cognitive 21) pkg/terminal/command.go:2094 — terminal.examineMemoryCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.configureSetSubstitutePath (cognitive 21) · ×1
  • terminal.configureSetSubstitutePath (cognitive 21) pkg/terminal/config.go:75 — terminal.configureSetSubstitutePath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, loops 8, boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.funcCallArgs (cognitive 20) · ×1
  • proc.funcCallArgs (cognitive 20) pkg/proc/fncall.go:610 — proc.funcCallArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbProcess.setCurrentBreakpoints (cognitive 20) · ×1
  • gdbProcess.setCurrentBreakpoints (cognitive 20) pkg/proc/gdbserial/gdbserver.go:1481 — gdbProcess.setCurrentBreakpoints has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · nativeThread.withDebugRegisters (cognitive 20) · ×1
  • nativeThread.withDebugRegisters (cognitive 20) pkg/proc/native/threads_linux_amd64.go:51 — nativeThread.withDebugRegisters has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 5, loops 3 (nesting depth added 7). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 53). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Variable.registerVariableTypeConv (cognitive 20) · ×1
  • Variable.registerVariableTypeConv (cognitive 20) pkg/proc/variables.go:2181 — Variable.registerVariableTypeConv has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, loops 5, match/switch 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.formatBreakpointAttrs (cognitive 20) · ×1
  • terminal.formatBreakpointAttrs (cognitive 20) pkg/terminal/command.go:1798 — terminal.formatBreakpointAttrs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · terminal.printcontextThread (cognitive 20) · ×1
  • terminal.printcontextThread (cognitive 20) pkg/terminal/command.go:2806 — terminal.printcontextThread has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Commands.printGoroutines (cognitive 20) · ×1
  • Commands.printGoroutines (cognitive 20) pkg/terminal/command.go:872 — Commands.printGoroutines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Client.CheckStopLocation (cognitive 20) · ×1
  • Client.CheckStopLocation (cognitive 20) service/dap/daptest/client.go:193 — Client.CheckStopLocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, loops 3, match/switch 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onScopesRequest (cognitive 20) · ×1
  • Session.onScopesRequest (cognitive 20) service/dap/server.go:2658 — Session.onScopesRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader.variablesInternal (cognitive 19) · ×1
  • reader.variablesInternal (cognitive 19) pkg/dwarf/reader/variables.go:41 — reader.variablesInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · proc.loadBinaryInfoMacho (cognitive 19) · ×1
  • proc.loadBinaryInfoMacho (cognitive 19) pkg/proc/bininfo.go:2131 — proc.loadBinaryInfoMacho has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.findTypeExpr (cognitive 19) · ×1
  • BinaryInfo.findTypeExpr (cognitive 19) pkg/proc/bininfo.go:2522 — BinaryInfo.findTypeExpr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · compileCtx.compileTypeCastOrFuncCall (cognitive 19) · ×1
  • compileCtx.compileTypeCastOrFuncCall (cognitive 19) pkg/proc/evalop/evalcompile.go:495 — compileCtx.compileTypeCastOrFuncCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 3, boolean chains 1, loops 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbThread.reloadGAtPC (cognitive 19) · ×1
  • gdbThread.reloadGAtPC (cognitive 19) pkg/proc/gdbserial/gdbserver.go:1822 — gdbThread.reloadGAtPC has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, boolean chains 1, loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.clearAll (cognitive 19) · ×1
  • terminal.clearAll (cognitive 19) pkg/terminal/command.go:1621 — terminal.clearAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.writeStructTo (cognitive 19) · ×1
  • Variable.writeStructTo (cognitive 19) service/api/prettyprint.go:312 — Variable.writeStructTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.writeMapTo (cognitive 19) · ×1
  • Variable.writeMapTo (cognitive 19) service/api/prettyprint.go:356 — Variable.writeMapTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.newNoDebugProcess (cognitive 19) · ×1
  • Session.newNoDebugProcess (cognitive 19) service/dap/server.go:1409 — Session.newNoDebugProcess has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, loops 2 (nesting depth added 7). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.stopDebugSession (cognitive 19) · ×1
  • Session.stopDebugSession (cognitive 19) service/dap/server.go:1569 — Session.stopDebugSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, match/switch 4, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugLineInfo.PrologueEndPC (cognitive 18) · ×1
  • DebugLineInfo.PrologueEndPC (cognitive 18) pkg/dwarf/line/state_machine.go:330 — DebugLineInfo.PrologueEndPC has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.callInjectionProtocol (cognitive 18) · ×1
  • proc.callInjectionProtocol (cognitive 18) pkg/proc/fncall.go:1151 — proc.callInjectionProtocol has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.resolveCallArgX86 (cognitive 18) · ×1
  • proc.resolveCallArgX86 (cognitive 18) pkg/proc/x86_disasm.go:70 — proc.resolveCallArgX86 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · core.buildMemory (cognitive 18) · ×1
  • core.buildMemory (cognitive 18) pkg/proc/core/linux_core.go:415 — core.buildMemory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, loops 7 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · debuginfod.execFind (cognitive 18) · ×1
  • debuginfod.execFind (cognitive 18) pkg/proc/debuginfod/debuginfod.go:16 — debuginfod.execFind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, loops 2, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 31, 43). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · stackIterator.tryFramePointerUnwind (cognitive 18) · ×1
  • stackIterator.tryFramePointerUnwind (cognitive 18) pkg/proc/stack.go:620 — stackIterator.tryFramePointerUnwind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 5, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TargetGroup.disableBreakpoint (cognitive 18) · ×1
  • TargetGroup.disableBreakpoint (cognitive 18) pkg/proc/target_group.go:416 — TargetGroup.disableBreakpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.reslice (cognitive 18) · ×1
  • Variable.reslice (cognitive 18) pkg/proc/eval.go:2952 — Variable.reslice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · G.readDefers (cognitive 18) · ×1
  • G.readDefers (cognitive 18) pkg/proc/stack.go:903 — G.readDefers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Commands.onCmd (cognitive 18) · ×1
  • Commands.onCmd (cognitive 18) pkg/terminal/command.go:3190 — Commands.onCmd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.ServeDAPCodec (cognitive 18) · ×1
  • Session.ServeDAPCodec (cognitive 18) service/dap/server.go:641 — Session.ServeDAPCodec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, match/switch 3, loops 1 (nesting depth added 11). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onSetVariableRequest (cognitive 18) · ×1
  • Session.onSetVariableRequest (cognitive 18) service/dap/server.go:3602 — Session.onSetVariableRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.state (cognitive 18) · ×1
  • Debugger.state (cognitive 18) service/debugger/debugger.go:589 — Debugger.state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, loops 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RPCClient.continueDir (cognitive 18) · ×1
  • RPCClient.continueDir (cognitive 18) service/rpc2/client.go:117 — RPCClient.continueDir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, loops 3 (nesting depth added 7). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 119). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · RPCServer.ListGoroutines (cognitive 18) · ×1
  • RPCServer.ListGoroutines (cognitive 18) service/rpc2/server.go:687 — RPCServer.ListGoroutines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmds.dapCmd (cognitive 17) · ×1
  • cmds.dapCmd (cognitive 17) cmd/dlv/cmds/commands.go:547 — cmds.dapCmd has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 1). Most of this is not in the body itself: 0 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 548). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · config.SplitQuotedFields (cognitive 17) · ×1
  • config.SplitQuotedFields (cognitive 17) pkg/config/split.go:16 — config.SplitQuotedFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, match/switch 5, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugLineInfo.FirstStmt (cognitive 17) · ×1
  • DebugLineInfo.FirstStmt (cognitive 17) pkg/dwarf/line/state_machine.go:359 — DebugLineInfo.FirstStmt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · goversion.Compatible (cognitive 17) · ×1
  • goversion.Compatible (cognitive 17) pkg/goversion/compat.go:26 — goversion.Compatible has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.minmaxBuiltin (cognitive 17) · ×1
  • proc.minmaxBuiltin (cognitive 17) pkg/proc/eval.go:2062 — proc.minmaxBuiltin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.allPointers (cognitive 17) · ×1
  • proc.allPointers (cognitive 17) pkg/proc/fncall.go:735 — proc.allPointers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 4, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.AddImage (cognitive 17) · ×1
  • BinaryInfo.AddImage (cognitive 17) pkg/proc/bininfo.go:1109 — BinaryInfo.AddImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.setValue (cognitive 17) · ×1
  • EvalScope.setValue (cognitive 17) pkg/proc/eval.go:621 — EvalScope.setValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.waitForvContStop (cognitive 17) · ×1
  • gdbConn.waitForvContStop (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:694 — gdbConn.waitForvContStop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.queryThreads (cognitive 17) · ×1
  • gdbConn.queryThreads (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:942 — gdbConn.queryThreads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.send (cognitive 17) · ×1
  • gdbConn.send (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:1331 — gdbConn.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native.waitForSearchProcess (cognitive 17) · ×1
  • native.waitForSearchProcess (cognitive 17) pkg/proc/native/proc_linux.go:231 — native.waitForSearchProcess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · processGroup.singleStep (cognitive 17) · ×1
  • processGroup.singleStep (cognitive 17) pkg/proc/native/threads_hardware_singlestep_linux.go:10 — processGroup.singleStep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, match/switch 3, boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.ClearSteppingBreakpoints (cognitive 17) · ×1
  • Target.ClearSteppingBreakpoints (cognitive 17) pkg/proc/breakpoints.go:943 — Target.ClearSteppingBreakpoints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Target.clearInactivatedSteppingBreakpoint (cognitive 17) · ×1
  • Target.clearInactivatedSteppingBreakpoint (cognitive 17) pkg/proc/breakpoints.go:967 — Target.clearInactivatedSteppingBreakpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TargetGroup.ChangeBreakpointCondition (cognitive 17) · ×1
  • TargetGroup.ChangeBreakpointCondition (cognitive 17) pkg/proc/target_group.go:449 — TargetGroup.ChangeBreakpointCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 3, boolean chains 2, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TargetGroup.manageUnsatisfiableBreakpoints (cognitive 17) · ×1
  • TargetGroup.manageUnsatisfiableBreakpoints (cognitive 17) pkg/proc/target_group.go:534 — TargetGroup.manageUnsatisfiableBreakpoints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.formatTime (cognitive 17) · ×1
  • Variable.formatTime (cognitive 17) pkg/proc/variables.go:2371 — Variable.formatTime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.continueUntilCompleteNext (cognitive 17) · ×1
  • terminal.continueUntilCompleteNext (cognitive 17) pkg/terminal/command.go:1381 — terminal.continueUntilCompleteNext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 3, match/switch 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.disassCommand (cognitive 17) · ×1
  • terminal.disassCommand (cognitive 17) pkg/terminal/command.go:2616 — terminal.disassCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.printBreakpointInfo (cognitive 17) · ×1
  • terminal.printBreakpointInfo (cognitive 17) pkg/terminal/command.go:2905 — terminal.printBreakpointInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 2 (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · pagingWriter.Write (cognitive 17) · ×1
  • pagingWriter.Write (cognitive 17) pkg/terminal/out.go:115 — pagingWriter.Write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · starbind.rep (cognitive 17) · ×1
  • starbind.rep (cognitive 17) pkg/terminal/starbind/repl.go:83 — starbind.rep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Session.onDataBreakpointInfoRequest (cognitive 17) · ×1
  • Session.onDataBreakpointInfoRequest (cognitive 17) service/dap/server.go:1929 — Session.onDataBreakpointInfoRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session.onDisassembleRequest (cognitive 17) · ×1
  • Session.onDisassembleRequest (cognitive 17) service/dap/server.go:3876 — Session.onDisassembleRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.Launch (cognitive 17) · ×1
  • Debugger.Launch (cognitive 17) service/debugger/debugger.go:277 — Debugger.Launch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Debugger.Functions (cognitive 17) · ×1
  • Debugger.Functions (cognitive 17) service/debugger/debugger.go:1377 — Debugger.Functions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, loops 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DebugLineInfo.AllPCsBetween (cognitive 16) · ×1
  • DebugLineInfo.AllPCsBetween (cognitive 16) pkg/dwarf/line/state_machine.go:175 — DebugLineInfo.AllPCsBetween has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.runtimeOptimizedWorkaround (cognitive 16) · ×1
  • proc.runtimeOptimizedWorkaround (cognitive 16) pkg/proc/fncall.go:1293 — proc.runtimeOptimizedWorkaround has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proc.GetG (cognitive 16) · ×1
  • proc.GetG (cognitive 16) pkg/proc/variables.go:258 — proc.GetG has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BinaryInfo.setGStructOffsetPE (cognitive 16) · ×1
  • BinaryInfo.setGStructOffsetPE (cognitive 16) pkg/proc/bininfo.go:2070 — BinaryInfo.setGStructOffsetPE has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, loops 1, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2071). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · BinaryInfo.ListPackagesBuildInfo (cognitive 16) · ×1
  • BinaryInfo.ListPackagesBuildInfo (cognitive 16) pkg/proc/bininfo.go:3196 — BinaryInfo.ListPackagesBuildInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, loops 5, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SplicedMemory.Add (cognitive 16) · ×1
  • SplicedMemory.Add (cognitive 16) pkg/proc/core/core.go:43 — SplicedMemory.Add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, match/switch 2, loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EvalScope.evalJump (cognitive 16) · ×1
  • EvalScope.evalJump (cognitive 16) pkg/proc/eval.go:1460 — EvalScope.evalJump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gdbConn.memoryRegionInfo (cognitive 16) · ×1
  • gdbConn.memoryRegionInfo (cognitive 16) pkg/proc/gdbserial/gdbserver_conn.go:1271 — gdbConn.memoryRegionInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native.Launch (cognitive 16) · ×1
  • native.Launch (cognitive 16) pkg/proc/native/proc_linux.go:65 — native.Launch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 90, 85). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · nativeThread.SetCurrentBreakpoint (cognitive 16) · ×1
  • nativeThread.SetCurrentBreakpoint (cognitive 16) pkg/proc/native/threads.go:93 — nativeThread.SetCurrentBreakpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Variable.mapAccess (cognitive 16) · ×1
  • Variable.mapAccess (cognitive 16) pkg/proc/eval.go:2885 — Variable.mapAccess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.restartRecorded (cognitive 16) · ×1
  • terminal.restartRecorded (cognitive 16) pkg/terminal/command.go:1190 — terminal.restartRecorded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · terminal.configureSetDebugInfoDirectories (cognitive 16) · ×1
  • terminal.configureSetDebugInfoDirectories (cognitive 16) pkg/terminal/config.go:150 — terminal.configureSetDebugInfoDirectories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Env.variableValueToStarlarkValue (cognitive 16) · ×1
  • Env.variableValueToStarlarkValue (cognitive 16) pkg/terminal/starbind/conv.go:242 — Env.variableValueToStarlarkValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, match/switch 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerImpl.Run (cognitive 16) · ×1
  • ServerImpl.Run (cognitive 16) service/rpccommon/server.go:106 — ServerImpl.Run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 3, loops 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 135). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 7 floating ref(s) across 2 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
D36 · Supply-chain Provenance & Signing · PR-triggered workflow without a permissions block · ×1
  • PR-triggered workflow without a permissions block — 1 workflow(s) triggered by pull_request declare no `permissions:` block (test-windows-arm64.yml) and so run with the repository's default GITHUB_TOKEN scope, while 1 sibling workflow in the same repository is already scoped. Pull-request runs build the least-trusted code in the repository; give each of these workflows its own least-privilege block — `permissions: {contents: read}` at the top of the workflow, widened per job only where a job genuinely writes.
D38 · OSV Dependency Vulnerabilities · Medium CVE · ×1
  • Medium CVE: GO-2025-3955 go.mod — stdlib 1.25.0 (net/http): GO-2025-3955 — fixed in Go 1.25.1; pin a build toolchain at or above it (go.mod `toolchain` directive, or your CI's Go version) — the `go` directive is a minimum language version, not the compiler that builds your binaries. This one row stands for the 39 advisories this scan raises against stdlib 1.25.0: GO-2025-3955, GO-2025-4006, GO-2025-4007, GO-2025-4008, GO-2025-4009, GO-2025-4010, GO-2025-4011, GO-2025-4012, GO-2025-4013, GO-2025-4014, GO-2025-4015, GO-2025-4155, GO-2025-4175, GO-2026-4337, GO-2026-4340, GO-2026-4341, GO-2026-4342, GO-2026-4601, GO-2026-4602, GO-2026-4603, GO-2026-4864, GO-2026-4865, GO-2026-4869, GO-2026-4870, GO-2026-4918, GO-2026-4946, GO-2026-4947, GO-2026-4970, GO-2026-4971, GO-2026-4976, GO-2026-4977, GO-2026-4980, GO-2026-4981, GO-2026-4982, GO-2026-4986, GO-2026-5037, GO-2026-5038, GO-2026-5039, GO-2026-5856.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) pkg/proc/arm64_arch.go:316 — pkg/proc/arm64_arch.go:316-341 | pkg/proc/ppc64le_arch.go:189-214 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/ppc64le_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) pkg/proc/amd64_arch.go:209 — pkg/proc/amd64_arch.go:209-233 | pkg/proc/i386_arch.go:135-159 — 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/proc/amd64_arch.go:209` it does not close everything it opens, so those exact 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 (24 lines × 3) · ×1
  • Duplicated block (24 lines × 3) pkg/proc/amd64_arch.go:174 — pkg/proc/amd64_arch.go:174-197 | pkg/proc/loong64_arch.go:172-195 | pkg/proc/riscv64_arch.go:195-218 — 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 transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) pkg/proc/loong64_arch.go:219 — pkg/proc/loong64_arch.go:219-237 | pkg/proc/riscv64_arch.go:242-260 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×1
  • Duplicated block (16 lines × 2) pkg/proc/loong64_arch.go:122 — pkg/proc/loong64_arch.go:122-137 | pkg/proc/riscv64_arch.go:141-156 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 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/proc/loong64_arch.go:122` it begins part-way through the construct above it, so those exact 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 (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) pkg/proc/arm64_arch.go:224 — pkg/proc/arm64_arch.go:224-240 | pkg/proc/ppc64le_arch.go:117-131 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/ppc64le_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 96 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/proc/arm64_arch.go:224` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) pkg/proc/loong64_arch.go:196 — pkg/proc/loong64_arch.go:196-208 | pkg/proc/riscv64_arch.go:219-231 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 128 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) pkg/proc/arm64_arch.go:105 — pkg/proc/arm64_arch.go:105-116 | pkg/proc/loong64_arch.go:82-93 | pkg/proc/ppc64le_arch.go:75-88 | pkg/proc/riscv64_arch.go:100-112 — 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/proc/arm64_arch.go:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 6) · ×1
  • Duplicated block (11 lines × 6) pkg/proc/amd64_arch.go:94 — pkg/proc/amd64_arch.go:94-104 | pkg/proc/arm64_arch.go:104-114 | pkg/proc/i386_arch.go:87-99 | pkg/proc/loong64_arch.go:81-91 | pkg/proc/ppc64le_arch.go:74-85 | pkg/proc/riscv64_arch.go:99-109 — 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/proc/amd64_arch.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.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) pkg/proc/linutil/regs_amd64_arch.go:94 — pkg/proc/linutil/regs_amd64_arch.go:94-104 | pkg/proc/linutil/regs_arm64_arch.go:79-89 | pkg/proc/linutil/regs_loong64_arch.go:85-98 | pkg/proc/linutil/regs_ppc64le_arch.go:131-141 | pkg/proc/linutil/regs_riscv64_arch.go:112-125 — 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/proc/linutil/regs_amd64_arch.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) pkg/proc/amd64_arch.go:137 — pkg/proc/amd64_arch.go:137-147 | pkg/proc/i386_arch.go:120-130 | pkg/proc/loong64_arch.go:120-130 | pkg/proc/riscv64_arch.go:139-149 — 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/proc/amd64_arch.go:137` it does not close everything it opens, so those 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) · ×1
  • Duplicated block (9 lines × 3) pkg/proc/stack_sigtramp.go:311 — pkg/proc/stack_sigtramp.go:311-319 | pkg/proc/stack_sigtramp.go:357-365 | pkg/proc/stack_sigtramp.go:437-445 — 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/proc/stack_sigtramp.go:311` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) pkg/proc/linutil/regs_arm64_arch.go:139 — pkg/proc/linutil/regs_arm64_arch.go:139-146 | pkg/proc/linutil/regs_loong64_arch.go:154-163 | pkg/proc/linutil/regs_ppc64le_arch.go:158-165 | pkg/proc/linutil/regs_riscv64_arch.go:182-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/proc/linutil/regs_arm64_arch.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) pkg/proc/arm64_arch.go:259 — pkg/proc/arm64_arch.go:259-266 | pkg/proc/loong64_arch.go:215-232 | pkg/proc/riscv64_arch.go:238-255 — 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/proc/arm64_arch.go:259` it begins part-way through the construct above it, so those exact 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...

    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.