Public report — lazygit, 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 @ 04:41 UTC Public
Code Health Audit

Jesseduffield/lazygit

No baseline yet — first run
61% Adequate
CriticalWeakAdequateStrongExemplary
middle

Medium · 67,458 LoC · rebuild ~1.1 person-years · weakest lens: Security (49%)

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
245findings with an exact file:lineof 257 — 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 lenses67458 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.

jesseduffield/lazygit is sound in substance but carries real gaps (61%). 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 (99%) — the structure is clean and changes stay contained. Readiness (85%) is solid too.

The area that most needs attention is Security (49%) — exposure to security and compliance incidents is elevated. Maturity (62%) is the next concern — onboarding is slow and knowledge is concentrated in too few people (a bus-factor risk).

Leadership focus, highest impact first: 24 High finding(s) (Static Analysis (SAST)); Record significant decisions one document per decision (Architecture documentation); 'Testing' section to the root README (Documentation (README)).

For scale: Medium (~67,458 production lines); rebuilding it from scratch would take roughly ~1.1 person-years (~1–3 engineers). Approximate, ±~30%.

It builds on a genuinely strong Architecture foundation (99%); 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.
Security 49% · 47% weightMaturity 62% · 26% weightCode Health 77% · 14% weightReadiness 85% · 8% weightArchitecture 99% · 4% weight

Raise Security 49 → 70 (the Healthy floor) ⇒ headline 61 → ~69.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €54,000–€270,000
Cost to rebuild€54,000–€270,000 (0.5–1.7 person-years (895–2,841 h), ~1–3 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 61% 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 ~1.1 person-years of build effort (about ~€160,000 to rebuild). Its weakest lens is Security at 49% — 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
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.
+4.2 pts · Low effort · Bus Factor
2
Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (18), release.yml (2), dependabot.yml.
+6.8 pts · Medium effort · Static Analysis (SAST)
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).
+6.3 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 1–3 engineer-days once. Not doing it costs about 11.7–77.8 engineer-days every year, paid as drag on the ~233,418 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–3 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 2–5% 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: 57,555 line(s) changed over a 90-day window ⇒ ~233,418/year · D1/D2/D4 code quality: averaging 7.4/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 3 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~1.1 person-years to rebuild), and its weakest lens is Security at 49%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~1.1 person-years rebuild (67,458 LoC) · weakest lens: Security 49%
→ Direct remediation budget at Security 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: Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (18), release.yml (2), dependabot.yml. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (18), release.yml (2), dependabot.yml.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.4/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% 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 7.4/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

56 modules, 206 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.)

…g/commands/git_config…kg/gui/mergeconflicts…lazygit/pkg/gui/style…ield/lazygit/pkg/i18n…eld/lazygit/pkg/tasks…mands/hosting_service…g/commands/oscommands…it/pkg/commands/patch…kg/gui/context/traits…i/modes/cherrypicking…azygit/pkg/gui/status…eld/lazygit/pkg/utils…t/pkg/commands/direnv…ygit/pkg/gui/filetree…g/gui/patch_exploring…d/lazygit/pkg/updates…zygit/pkg/gui/context…i/controllers/helpers…t/pkg/gui/controllers…eld/lazygit/pkg/gocui…ld/lazygit/pkg/config…ld/lazygit/pkg/common…eld/lazygit/pkg/theme…azygit/pkg/app/daemon…commands/git_commands…/lazygit/pkg/commands…lazygit/pkg/gui/types…azygit/pkg/cheatsheet…t/pkg/commands/models…lazygit/pkg/gui/popup…ui/presentation/icons…vices/custom_commands…pkg/integration/types…lazygit/pkg/app/types…eld/lazygit/pkg/fakes…ui/presentation/graph…ntegration/components…field/lazygit/pkg/gui…/pkg/gui/presentation…field/lazygit/pkg/app…g/commands/git_config1…kg/gui/mergeconflicts2…lazygit/pkg/gui/style3…ield/lazygit/pkg/i18n4…eld/lazygit/pkg/tasks5…mands/hosting_service6…g/commands/oscommands7…it/pkg/commands/patch8…kg/gui/context/traits9…i/modes/cherrypicking10…azygit/pkg/gui/status11…eld/lazygit/pkg/utils12…t/pkg/commands/direnv13…ygit/pkg/gui/filetree14…g/gui/patch_exploring15…d/lazygit/pkg/updates16…zygit/pkg/gui/context17…i/controllers/helpers18…t/pkg/gui/controllers19…eld/lazygit/pkg/gocui20…ld/lazygit/pkg/config21…ld/lazygit/pkg/common22…eld/lazygit/pkg/theme23…azygit/pkg/app/daemon24…commands/git_commands25…/lazygit/pkg/commands26…lazygit/pkg/gui/types27…azygit/pkg/cheatsheet28…t/pkg/commands/models29…lazygit/pkg/gui/popup30…ui/presentation/icons31…vices/custom_commands32…pkg/integration/types33…lazygit/pkg/app/types34…eld/lazygit/pkg/fakes35…ui/presentation/graph36…ntegration/components37…field/lazygit/pkg/gui38…/pkg/gui/presentation39…field/lazygit/pkg/app402112121111112231161512221221261111012401312221151238361463612521528112572222261026222424412141111123272434222917113411121518421141132110151611273412121121113513211121221413513211121325451551425499123552132212431121411122131+16 more modules (most-connected shown)

At a glance — Code Health · 77% · Strong

At a glance — Architecture · 99% · Exemplary

At a glance — Maturity · 62% · Adequate · gated by M2

At a glance — Readiness · 85% · Strong

At a glance — Security · 49% · Weak · 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 — Injection37High / Critical
A05:2021 — Security Misconfiguration2High / Critical

Roadmap

Begin by resolving the 24 high-priority static analysis findings, focusing first on the CI and release configuration files. Next, document significant architectural decisions in a dedicated ADR folder to capture context and consequences. Then, update the root README to include a section on how to run the test suite. Finally, address the single off-boarding risk to improve team resilience, and resolve the high-severity finding in the Dockerfile to secure the container environment.

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

Do thisHelpsEffortDimension
Resolve the 1 Off-boarding risk finding(s) in Bus Factor.+4.2 ptsLowBus Factor
Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (18), release.yml (2), dependabot.yml.+6.8 ptsMediumStatic Analysis (SAST)
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).+6.3 ptsMediumArchitecture documentation
Add a 'Testing' section to the root README — how to run the test suite.+5.9 ptsMediumDocumentation (README)
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with Dockerfile.+2.4 ptsLowIaC & Container Security
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing.+2.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing.+2.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing.+2.4 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
.github/workflows/ci.yml4.4MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
Dockerfile5.1MixedIaC & Container Security: High IaC: DS-0002
pkg/app/entry_point.go5.7MixedStatic Analysis (SAST): Medium: use-tls
pkg/gui/presentation/commits.go5.7MixedCyclomatic Complexity: presentation.displayCommit (cyclomatic 23)
.github/workflows/release.yml5.8MixedStatic Analysis (SAST): High: github-actions-mutable-action-tag
pkg/app/app.go6.3MixedCyclomatic Complexity: App.setupRepo (cyclomatic 18)
pkg/gui/controllers/workspace_reset_controller.go6.4MixedStatic Analysis (SAST): Medium: math-random-used
pkg/integration/components/shell.go6.4MixedStatic Analysis (SAST): Medium: math-random-used
pkg/gocui/gui.go7.0MixedCyclomatic Complexity: Gui.onKey (cyclomatic 49)
pkg/gocui/view.go7.0MixedCyclomatic Complexity: View.draw (cyclomatic 19)
pkg/config/app_config.go7.0MixedCyclomatic Complexity: config.computeMigratedConfig (cyclomatic 18)
pkg/gui/controllers/local_commits_controller.go7.0MixedGod Classes: TooManyMethods: LocalCommitsController
pkg/gocui/escape.go7.1MixedCyclomatic Complexity: escapeInterpreter.parseOne (cyclomatic 69)
pkg/gui/controllers/helpers/refresh_helper.go7.1MixedCyclomatic Complexity: RefreshHelper.performRefresh (cyclomatic 40)
pkg/gui/controllers/helpers/window_arrangement_helper.go7.1MixedCyclomatic Complexity: helpers.shrinkToContentSidePanelBoxes (cyclomatic 26)
pkg/gui/gui.go7.1MixedCyclomatic Complexity: Gui.onNewRepo (cyclomatic 20)
pkg/commands/git_commands/working_tree.go7.1MixedCyclomatic Complexity: WorkingTreeCommands.DiscardAllDirChanges (cyclomatic 17)
pkg/gui/presentation/graph/graph.go7.2MixedCyclomatic Complexity: graph.renderPipeSet (cyclomatic 31)
pkg/integration/clients/tui.go7.2MixedCyclomatic Complexity: clients.RunTUI (cyclomatic 19)
pkg/commands/git_commands/patch.go7.2MixedCognitive Complexity: PatchCommands.MovePatchToSelectedCommit (cognitive 16)

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
D1D2D3D4D13D15D16D19D21D28D29D31D34D35D36AX5M1M2M3M4P1P3P4P6

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, 245 of 257 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
jscpdCode duplication✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.302✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.302✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 019fd560-8c22-77a5-90e2-7f24e3b37a78.

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").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (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 Complexity6.4 / 10Adequate✓ 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 6.4 / 10 · rule-coverage 100% · ceiling Prevented

40 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was escapeInterpreter.parseOne at 69. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being gocui.SimpleEditor at 20 — they are counted neither in the figure above nor in this dimension's score.

escapeInterpreter.parseOne (cyclomatic 69)pkg/gocui/escape.go:237
graph.getBoxDrawingChars (cyclomatic 65)pkg/gui/presentation/graph/cell.go:147
Gui.onKey (cyclomatic 49)pkg/gocui/gui.go:1663
Gui.layout (cyclomatic 42)pkg/gui/layout.go:13
RefreshHelper.performRefresh (cyclomatic 40)pkg/gui/controllers/helpers/refresh_helper.go:168

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

What to do

  1. Resolve the 1 escapeInterpreter.parseOne (cyclomatic 69) finding(s) in Cyclomatic Complexity — start with escape.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 graph.getBoxDrawingChars (cyclomatic 65) finding(s) in Cyclomatic Complexity — start with cell.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Gui.onKey (cyclomatic 49) finding(s) in Cyclomatic Complexity — start with gui.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 Complexity6.1 / 10Adequate✓ 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 6.1 / 10 · rule-coverage 100% · ceiling Prevented

84 method(s) exceeded the cognitive complexity threshold of 15; the worst was Gui.onKey at 94.

Gui.onKey (cognitive 94)pkg/gocui/gui.go:1663
ViewBufferManager.NewCmdTask (cognitive 61)pkg/tasks/tasks.go:167
Gui.layout (cognitive 60)pkg/gui/layout.go:13
escapeInterpreter.parseOne (cognitive 52)pkg/gocui/escape.go:237
presentation.getBranchDisplayStrings (cognitive 50)pkg/gui/presentation/branches.go:47

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

What to do

  1. Resolve the 1 Gui.onKey (cognitive 94) finding(s) in Cognitive Complexity — start with gui.go. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 ViewBufferManager.NewCmdTask (cognitive 61) finding(s) in Cognitive Complexity — start with tasks.go. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Gui.layout (cognitive 60) finding(s) in Cognitive Complexity — start with layout.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.6 / 10Strong✓ Tool-verified

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

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

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

27 god class(es) detected.

TooManyMethods: Gui · ×16pkg/gui/gui.go:62
FileTooLong: i18n/english.go · ×11pkg/i18n/english.go:0

What to do

  1. Resolve the 16 TooManyMethods finding(s) in God Classes — start with gui.go (2), view.go, local_commits_controller.go. — One of this dimension's main actionable groups (16 warning-level).
  2. Resolve the 11 FileTooLong finding(s) in God Classes — start with gui.go (2), english.go, local_commits_controller.go. — One of this dimension's main actionable groups (11 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

39 duplicated block group(s) detected.

Duplicated block (11 lines × 2) · ×6pkg/config/keybinding.go:51
Duplicated block (9 lines × 2) · ×6pkg/gui/controllers/branches_controller.go:237
Duplicated block (7 lines × 2) · ×5pkg/commands/git_commands/file.go:48
Duplicated block (10 lines × 2) · ×4pkg/config/app_config.go:392
Duplicated block (6 lines × 2) · ×4pkg/gui/controllers/bisect_controller.go:169

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

Top hotspots: pkg/gui/controllers/helpers/refresh_helper.go (72×40=2880); pkg/gocui/gui.go (21×49=1029); pkg/gui/gui.go (25×20=500)

Hotspot: pkg/gui/controllers/helpers/refresh_helper.go · ×10pkg/gui/controllers/helpers/refresh_helper.go

✓ On the Gold path — maintain.

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

D16 · Bus Factor4.9 / 10Weak✓ 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 4.9 / 10 · rule-coverage 100% · ceiling Documented

120 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/gui/controllers/helpers/refresh_helper.go.

Off-boarding risk: anonymized user #1

What to do

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D19 · Documentation Quality / 10Strong◐ 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 Strong / 10 · rule-coverage 100% · ceiling Documented

Clear and comprehensive documentation for lazygit (README + architecture docs) with a strong focus on the UI/UX side. The README is an excellent elevator pitch that explains what lazygit does, its sponsors, and where to find more info, while architecture/Docs markdown files cover every aspect of the project: integration tests, GOCUI, translations, filetree, fixup commits, custom diff renderers, undo/redo, stacked branches, searching/filtering. The README also links out to a full table of contents (Sponsors; Elevator Pitch; Table of contents; Features; Stage individual lines; Interactive Rebase; Cherry-pick; Bisect; Nuke the working tree; Amend an old commit; Filter; Invoke a custom command; Worktrees; Rebase magic (custom patches); Rebase from marked base commit; Undo; Commit graph; Compare two commits; Show GitHub pull requests; Tutorials; Installation; Binary Releases; Dev container feature; Homebrew; MacPorts; Void Linux; Scoop (Windows); Add the extras bucket; Install lazygit; gah). The lazygit documentation is clear and complete for a Git tool: the README covers custom command keybindings with code examples, a full Config.md guide on global/local repo-specific config paths, YAML-language-server configuration, and a dedicated keybinding zh-CN/zh-TW/ru/pl/i18n file that auto-generates and lists every key mapped in the package. The keybinding docs are especially thorough for a command-line tool — each key has an Action column plus Info describing how it behaves (e.g., push/pull, rename similarity threshold, diff context size), with cross-sections on navigation, worktree handling, reflog, stash, and more.

What to do

  1. Improve Documentation Quality — currently 8.3/10. — Clear and comprehensive documentation for lazygit (README + architecture docs) with a strong focus on the UI/UX side. The README is an excellent elevator pitch that explains what lazygit does, its sponsors, and where to find more info, while architecture/Docs markdown files cover every aspect of the project: integration tests, GOCUI, translations, filetree, fixup commits, custom diff renderers, undo/redo, stacked branches, searching/filtering. The README also links out to a full table of contents (Sponsors; Elevator Pitch; Table of contents; Features; Stage individual lines; Interactive Rebase; Cherry-pick; Bisect; Nuke the working tree; Amend an old commit; Filter; Invoke a custom command; Worktrees; Rebase magic (custom patches); Rebase from marked base commit; Undo; Commit graph; Compare two commits; Show GitHub pull requests; Tutorials; Installation; Binary Releases; Dev container feature; Homebrew; MacPorts; Void Linux; Scoop (Windows); Add the extras bucket; Install lazygit; gah). The lazygit documentation is clear and complete for a Git tool: the README covers custom command keybindings with code examples, a full Config.md guide on global/local repo-specific config paths, YAML-language-server configuration, and a dedicated keybinding zh-CN/zh-TW/ru/pl/i18n file that auto-generates and lists every key mapped in the package. The keybinding docs are especially thorough for a command-line tool — each key has an Action column plus Info describing how it behaves (e.g., push/pull, rename similarity threshold, diff context size), with cross-sections on navigation, worktree handling, reflog, stash, and more.

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

38 finding(s): 0 critical, 24 high, 6 medium, 8 low.

High: dependabot-missing-cooldown · ×24.github/dependabot.yml:3detected by semgrep finding
Medium: use-tls · ×6pkg/app/entry_point.go:169detected by semgrep finding
Low: use-of-unsafe-block · ×7pkg/commands/oscommands/pty_windows.go:246detected by semgrep finding

What to do

  1. Resolve the 24 High finding(s) in Static Analysis (SAST) — start with ci.yml (18), release.yml (2), dependabot.yml. — One of this dimension's main actionable groups (24 issue-level).
  2. Resolve the 7 Low finding(s) in Static Analysis (SAST) — start with pty_windows.go (5), gui_others.go, gui_windows.go. — One of this dimension's main actionable groups (7 recommendation-level).
  3. Resolve the 6 Medium finding(s) in Static Analysis (SAST) — start with entry_point.go, command_log_panel.go, workspace_reset_controller.go. — One of this dimension's main actionable groups (6 warning-level).

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

D31 · IaC & Container Security9.6 / 10Exemplary✓ Tool-verified

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

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

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

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

High IaC: DS-0002Dockerfiledetected by trivy finding
Medium IaC: CKV_DOCKER_3Dockerfile:1detected by trivy finding

✓ On the Gold path — maintain.

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

D34 · Knowledge 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

19 of 229 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/integration/components/random.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.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: status_controller.go↔status.go 70%; app.go↔dummies.go 62%; cli.go↔main.go 60%

Change coupling: status_controller.go ↔ status.go · ×6pkg/gui/controllers/status_controller.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 & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

0/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 artifact signing
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.

Frontend & cross-cutting dimensions

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

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

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

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

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

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

What to do

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

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

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

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

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

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

P3 · Security & performance tooling8.0 / 10Strong✓ Tool-verified

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

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

What to do

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

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

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

P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

Reference — by lens

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

LensScoreRatingImpact
Code Health77%StrongSolid.
Architecture99%ExemplaryStrongest area.
Maturity62%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness85%StrongSolid.
Security49%Weak — 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 — ~54973 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) 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.
  • 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.
  • D38 OSV Dependency Vulnerabilities — Scanner failed to run — not a clean result
  • 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, 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): 3 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 3 value object(s)
  • ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 2 CQRS handler(s); 4 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 — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 aggregate(s) with Apply/When folds; 4 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • 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 — 25 finding(s)
D29 · Static Analysis (SAST) · High · ×24
  • High: dependabot-missing-cooldown .github/dependabot.yml:3 — This Dependabot configuration does not set a cooldown period. Newly published packages can be malicious or unstable. Add a `cooldown` block with `default-days: 7` to each `package-ecosystem` entry under `updates` to wait 7 days before proposing updates to newly published package versions. Reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#cooldown. This is a semgrep security-AUDIT rule reporting a POLICY that is absent or weaker than its recommendation, not an exploitable defect. Confirm whether the current setting is a deliberate decision for this repository — and apply the change where it is not; where it is (a policy your release process already enforces elsewhere, or one this repository has consciously opted out of), record the decision and leave the configuration as it is. This configuration file has 2 such entries; one cooldown decision clears them all — reported once.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:31 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:33 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:42 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:70 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:74 — 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/cache/restore@<40-character SHA>`. This step references `actions/cache/restore@v6`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v6 --jq .sha`. `actions/cache/restore` is hosted INSIDE the `actions/cache` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `actions/cache/restore` path in `uses:` and query only `actions/cache`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:91 — 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/cache/save@<40-character SHA>`. This step references `actions/cache/save@v6`; resolve the SHA it points at today with `gh api repos/actions/cache/commits/v6 --jq .sha`. `actions/cache/save` is hosted INSIDE the `actions/cache` repository (a subdirectory action or a reusable workflow), so the SHA to pin is that repository's commit — keep the full `actions/cache/save` path in `uses:` and query only `actions/cache`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:96 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:120 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/upload-artifact/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:131 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:133 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:158 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:160 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:184 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:186 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:206 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:209 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:214 — 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/download-artifact@<40-character SHA>`. This step references `actions/download-artifact@v8`; resolve the SHA it points at today with `gh api repos/actions/download-artifact/commits/v8 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/ci.yml:245 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/close-issues.yml:15 — 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/github-script@<40-character SHA>`. This step references `actions/github-script@v9`; resolve the SHA it points at today with `gh api repos/actions/github-script/commits/v9 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/codespell.yml:21 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:54 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/release.yml:163 — 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@v6`; resolve the SHA it points at today with `gh api repos/actions/setup-go/commits/v6 --jq .sha`.
  • High: github-actions-mutable-action-tag .github/workflows/sponsors.yml:13 — 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@v7`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v7 --jq .sha`.
D31 · IaC & Container Security · High IaC · ×1
  • High IaC: DS-0002 Dockerfile — Image user should not be 'root' A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN adduser -S -D app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
Warning — 215 finding(s)
D3 · God Classes · TooManyMethods · ×16
  • TooManyMethods: Gui pkg/gui/gui.go:62 — TooManyMethods — 139 methods, declared across 20 files: gui/gui.go (32), gui/global_handlers.go (20), gui/keybindings.go (11), gui/main_panels.go (11), +16 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: View pkg/gocui/view.go:30 — TooManyMethods — 104 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: Gui pkg/gocui/gui.go:126 — TooManyMethods — 89 methods, declared across 3 files: gocui/gui.go (85), gocui/tcell_driver.go (3), gocui/gui_others.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: LocalCommitsController pkg/gui/controllers/local_commits_controller.go:32 — TooManyMethods — 83 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: FilesController pkg/gui/controllers/files_controller.go:20 — TooManyMethods — 75 methods, declared across 2 files: controllers/files_controller.go (72), controllers/workspace_reset_controller.go (3). 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: Shell pkg/integration/components/shell.go:17 — 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: ViewDriver pkg/integration/components/view_driver.go:12 — TooManyMethods — 56 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: guiCommon pkg/gui/gui_common.go:14 — TooManyMethods — 48 methods. Most of these members implement types.IGuiCommon (46 of 48 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
  • TooManyMethods: RefreshHelper pkg/gui/controllers/helpers/refresh_helper.go:29 — TooManyMethods — 45 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: TextArea pkg/gocui/text_area.go:31 — TooManyMethods — 38 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: BranchesController pkg/gui/controllers/branches_controller.go:19 — TooManyMethods — 37 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: State pkg/gui/patch_exploring/state.go:16 — TooManyMethods — 37 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: WorkingTreeCommands pkg/commands/git_commands/working_tree.go:18 — 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: RebaseCommands pkg/commands/git_commands/rebase.go:17 — TooManyMethods — 35 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: Views pkg/integration/components/views.go:9 — TooManyMethods — 33 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: GuiDriver pkg/gui/gui_driver.go:19 — TooManyMethods — 31 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.
D3 · God Classes · FileTooLong · ×11
  • FileTooLong: i18n/english.go pkg/i18n/english.go:0 — FileTooLong — 2233 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: controllers/local_commits_controller.go pkg/gui/controllers/local_commits_controller.go:0 — FileTooLong — 1215 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: gocui/view.go pkg/gocui/view.go:0 — FileTooLong — 1144 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: gocui/gui.go pkg/gocui/gui.go:0 — FileTooLong — 1099 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: controllers/files_controller.go pkg/gui/controllers/files_controller.go:0 — FileTooLong — 1046 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: helpers/refresh_helper.go pkg/gui/controllers/helpers/refresh_helper.go:0 — FileTooLong — 893 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: icons/file_icons.go pkg/gui/presentation/icons/file_icons.go:0 — FileTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: extIconMap (223-757). Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: config/user_config.go pkg/config/user_config.go:0 — FileTooLong — 749 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: gui/gui.go pkg/gui/gui.go:0 — FileTooLong — 725 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: controllers/branches_controller.go pkg/gui/controllers/branches_controller.go:0 — FileTooLong — 581 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: config/app_config.go pkg/config/app_config.go:0 — FileTooLong — 520 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: pkg/gui/controllers/helpers/refresh_helper.go pkg/gui/controllers/helpers/refresh_helper.go — pkg/gui/controllers/helpers/refresh_helper.go changed 72 times in last 90 days, max complexity 40. 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/gocui/gui.go pkg/gocui/gui.go — pkg/gocui/gui.go changed 21 times in last 90 days, max complexity 49. 1 of those changes was a fix/bug commit, and the other 20 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/gui/gui.go pkg/gui/gui.go — pkg/gui/gui.go changed 25 times in last 90 days, max complexity 20. 1 of those changes was a fix/bug commit, and the other 24 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/gocui/escape.go pkg/gocui/escape.go — pkg/gocui/escape.go changed 5 times in last 90 days, max complexity 69. 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/tasks/tasks.go pkg/tasks/tasks.go — pkg/tasks/tasks.go changed 10 times in last 90 days, max complexity 33. 1 of those changes was a fix/bug commit, and the other 9 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/gui/controllers/helpers/merge_and_rebase_helper.go pkg/gui/controllers/helpers/merge_and_rebase_helper.go — pkg/gui/controllers/helpers/merge_and_rebase_helper.go changed 19 times in last 90 days, max complexity 15. 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/gui/layout.go pkg/gui/layout.go — pkg/gui/layout.go changed 5 times in last 90 days, max complexity 42. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: pkg/gocui/view.go pkg/gocui/view.go — pkg/gocui/view.go changed 11 times in last 90 days, max complexity 19. 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/gocui/tcell_driver.go pkg/gocui/tcell_driver.go — pkg/gocui/tcell_driver.go changed 5 times in last 90 days, max complexity 35. 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/config/app_config.go pkg/config/app_config.go — pkg/config/app_config.go changed 6 times in last 90 days, max complexity 18. 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.
D29 · Static Analysis (SAST) · Medium · ×6
  • Medium: use-tls pkg/app/entry_point.go:169 — Found an HTTP server without TLS. Use 'http.ListenAndServeTLS' instead. See https://golang.org/pkg/net/http/#ListenAndServeTLS for more information. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
  • Medium: math-random-used pkg/gui/command_log_panel.go:5 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used pkg/gui/controllers/workspace_reset_controller.go:8 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: use-of-md5 pkg/gui/presentation/authors/authors.go:94 — Detected MD5 hash algorithm which is considered insecure. MD5 is not collision resistant and is therefore not suitable as a cryptographic signature. Use SHA256 or SHA3 instead. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used pkg/integration/components/shell.go:6 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
  • Medium: math-random-used pkg/snake/snake.go:4 — `math/rand` is not cryptographically secure — its stream is reproducible from its seed and predictable from observed output — so any value that must be unguessable (a token, nonce, key, salt, session id, password-reset or MFA code) has to come from `crypto/rand`. Where non-cryptographic randomness IS the intent — jitter, backoff, sampling, load spreading, simulation, test fixtures, or output that is deliberately reproducible from a seed — `math/rand` is the correct choice and no change is needed; a package that deliberately offers both should keep its security-sensitive callers on the `crypto/rand` path rather than drop the other one. This is a semgrep security-AUDIT rule: it reports that a sensitive pattern is present, not that it is exploitable here. Confirm whether the flagged value reaches a security decision — a credential, token, nonce, key, salt or session id, or an externally reachable surface — and apply the change where it does; where it provably does not (cosmetic, simulation, or deliberately reproducible use), record the review and leave the code as it is.
D35 · Change Coupling · Change coupling · ×6
  • Change coupling: status_controller.go ↔ status.go pkg/gui/controllers/status_controller.go — `pkg/gui/controllers/status_controller.go` and `pkg/gui/presentation/status.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) 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: app.go ↔ dummies.go pkg/app/app.go — `pkg/app/app.go` and `pkg/gui/dummies.go` change together 62% of the time (8 of the 13 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: cli.go ↔ main.go pkg/integration/clients/cli.go — `pkg/integration/clients/cli.go` and `pkg/integration/clients/injector/main.go` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: git.go ↔ commit_file.go pkg/commands/git.go — `pkg/commands/git.go` and `pkg/commands/models/commit_file.go` change together 57% of the time (8 of the 14 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: commit.go ↔ diff.go pkg/commands/git_commands/commit.go — `pkg/commands/git_commands/commit.go` and `pkg/commands/git_commands/diff.go` change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: commits.go ↔ reflog_commits.go pkg/gui/presentation/commits.go — `pkg/gui/presentation/commits.go` and `pkg/gui/presentation/reflog_commits.go` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well). 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 (11 lines × 2) · ×6
  • Duplicated block (11 lines × 2) pkg/config/keybinding.go:51 — pkg/config/keybinding.go:51-61 | pkg/config/side_panel.go:33-43 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. The matched lines also transfer control out of the body holding them, 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/gocui/escape.go:313 — pkg/gocui/escape.go:313-323 | pkg/gocui/escape.go:408-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gocui/escape.go:313` it begins part-way through the construct above it, so those exact 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/gui/context/local_commits_context.go:382 — pkg/gui/context/local_commits_context.go:382-392 | pkg/gui/context/sub_commits_context.go:232-242 — 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/gui/context/local_commits_context.go:382` it begins part-way through the construct above it, so those exact lines 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/gui/controllers/tags_controller.go:177 — pkg/gui/controllers/tags_controller.go:177-187 | pkg/gui/controllers/tags_controller.go:227-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/tags_controller.go:177` it does not close everything it opens, so those exact lines 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/gui/controllers/tags_controller.go:197 — pkg/gui/controllers/tags_controller.go:197-207 | pkg/gui/controllers/tags_controller.go:247-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/tags_controller.go:197` it begins part-way through the construct above it, so those exact lines 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/gui/global_handlers.go:26 — pkg/gui/global_handlers.go:26-40 | pkg/gui/global_handlers.go:47-57 — both copies are in the same file, so extract the 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 (9 lines × 2) · ×6
  • Duplicated block (9 lines × 2) pkg/gui/controllers/branches_controller.go:237 — pkg/gui/controllers/branches_controller.go:237-245 | pkg/gui/controllers/branches_controller.go:270-278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/branches_controller.go:237` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) pkg/gui/controllers/commits_files_controller.go:497 — pkg/gui/controllers/commits_files_controller.go:497-505 | pkg/gui/controllers/commits_files_controller.go:555-563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/commits_files_controller.go:497` it does not close everything it opens, so those exact lines 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/gui/controllers/helpers/branches_helper.go:44 — pkg/gui/controllers/helpers/branches_helper.go:44-52 | pkg/gui/controllers/helpers/branches_helper.go:319-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/helpers/branches_helper.go:319` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/gui/controllers/helpers/branches_helper.go:156 — pkg/gui/controllers/helpers/branches_helper.go:156-164 | pkg/gui/controllers/helpers/branches_helper.go:339-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/helpers/branches_helper.go:339` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/gui/controllers/helpers/branches_helper.go:320 — pkg/gui/controllers/helpers/branches_helper.go:320-328 | pkg/gui/controllers/helpers/branches_helper.go:340-348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/helpers/branches_helper.go:320` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) pkg/gui/controllers/helpers/refs_helper.go:538 — pkg/gui/controllers/helpers/refs_helper.go:538-546 | pkg/gui/controllers/helpers/refs_helper.go:568-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/controllers/helpers/refs_helper.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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) pkg/commands/git_commands/file.go:48 — pkg/commands/git_commands/file.go:48-54 | pkg/commands/git_commands/file.go:60-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (7 lines × 2) pkg/gocui/gui.go:462 — pkg/gocui/gui.go:462-468 | pkg/gocui/gui.go:477-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gocui/gui.go:462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. 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/gui/controllers/local_commits_controller.go:771 — pkg/gui/controllers/local_commits_controller.go:771-777 | pkg/gui/controllers/local_commits_controller.go:787-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/local_commits_controller.go:771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pkg/gui/controllers/local_commits_controller.go:845 — pkg/gui/controllers/local_commits_controller.go:845-851 | pkg/gui/controllers/local_commits_controller.go:1526-1532 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/local_commits_controller.go:845` it does not close everything it opens, so those 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/gui/controllers/local_commits_controller.go:1431 — pkg/gui/controllers/local_commits_controller.go:1431-1437 | pkg/gui/controllers/local_commits_controller.go:1542-1548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/local_commits_controller.go:1431` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×4
  • Duplicated block (10 lines × 2) pkg/config/app_config.go:392 — pkg/config/app_config.go:392-402 | pkg/config/app_config.go:414-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/config/app_config.go:392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) pkg/gui/controllers/commits_files_controller.go:227 — pkg/gui/controllers/commits_files_controller.go:227-236 | pkg/gui/controllers/files_controller.go:1366-1375 — 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/gui/controllers/commits_files_controller.go:227` it begins part-way through the construct above it, so those exact lines 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/integration/clients/tui.go:116 — pkg/integration/clients/tui.go:116-125 | pkg/integration/clients/tui.go:130-139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/integration/clients/tui.go:116` it begins part-way through the construct above it, so those exact lines 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/gui/view_helpers.go:78 — pkg/gui/view_helpers.go:78-87 | pkg/gui/view_helpers.go:96-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/view_helpers.go:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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) · ×4
  • Duplicated block (6 lines × 2) pkg/gui/controllers/bisect_controller.go:169 — pkg/gui/controllers/bisect_controller.go:169-174 | pkg/gui/controllers/bisect_controller.go:187-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/bisect_controller.go:169` it does not close everything it opens, so those exact lines 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/gui/controllers/files_controller.go:1737 — pkg/gui/controllers/files_controller.go:1737-1742 | pkg/gui/controllers/files_controller.go:1763-1768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/files_controller.go:1737` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (6 lines × 2) pkg/gui/controllers/helpers/branches_helper.go:30 — pkg/gui/controllers/helpers/branches_helper.go:30-35 | pkg/gui/controllers/helpers/branches_helper.go:107-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/controllers/helpers/branches_helper.go:30` it begins part-way through the construct above it, so those exact lines 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/gui/controllers/local_commits_controller.go:1318 — pkg/gui/controllers/local_commits_controller.go:1318-1323 | pkg/gui/controllers/local_commits_controller.go:1341-1346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/local_commits_controller.go:1318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×3
  • Duplicated block (14 lines × 2) pkg/commands/git_commands/patch.go:93 — pkg/commands/git_commands/patch.go:93-107 | pkg/commands/git_commands/patch.go:282-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/commands/git_commands/patch.go:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14 lines × 2) pkg/gui/controllers/custom_patch_options_menu_action.go:196 — pkg/gui/controllers/custom_patch_options_menu_action.go:196-209 | pkg/gui/controllers/custom_patch_options_menu_action.go:231-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/custom_patch_options_menu_action.go:196` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) pkg/gui/controllers/helpers/refs_helper.go:547 — pkg/gui/controllers/helpers/refs_helper.go:547-560 | pkg/gui/controllers/helpers/refs_helper.go:583-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/controllers/helpers/refs_helper.go:547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) pkg/gui/controllers/custom_patch_options_menu_action.go:135 — pkg/gui/controllers/custom_patch_options_menu_action.go:135-139 | pkg/gui/controllers/patch_building_controller.go:226-230 — 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/gui/controllers/custom_patch_options_menu_action.go:135` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) pkg/gui/controllers/helpers/refs_helper.go:282 — pkg/gui/controllers/helpers/refs_helper.go:282-286 | pkg/gui/controllers/workspace_reset_controller.go:163-167 — 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/gui/controllers/helpers/refs_helper.go:282` it does not close everything it opens, so those 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) pkg/gui/controllers/helpers/working_tree_helper.go:236 — pkg/gui/controllers/helpers/working_tree_helper.go:236-241 | pkg/gui/controllers/helpers/working_tree_helper.go:258-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/controllers/helpers/working_tree_helper.go:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) pkg/commands/git_commands/patch.go:177 — pkg/commands/git_commands/patch.go:177-191 | pkg/commands/git_commands/patch.go:287-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/commands/git_commands/patch.go:177` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) pkg/gui/controllers/helpers/merge_and_rebase_helper.go:441 — pkg/gui/controllers/helpers/merge_and_rebase_helper.go:441-455 | pkg/gui/controllers/helpers/merge_and_rebase_helper.go:472-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/gui/controllers/helpers/merge_and_rebase_helper.go:441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×2
  • Duplicated block (13 lines × 2) pkg/gui/filetree/commit_file_tree_view_model.go:168 — pkg/gui/filetree/commit_file_tree_view_model.go:168-180 | pkg/gui/filetree/file_tree_view_model.go:179-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/gui/filetree/commit_file_tree_view_model.go:168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) pkg/gui/presentation/files.go:306 — pkg/gui/presentation/files.go:306-318 | pkg/gui/presentation/files.go:334-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/presentation/files.go:306` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×2
  • Duplicated block (8 lines × 2) pkg/gui/controllers/branches_controller.go:255 — pkg/gui/controllers/branches_controller.go:255-262 | pkg/gui/controllers/helpers/merge_and_rebase_helper.go:409-417 — 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/gui/controllers/helpers/merge_and_rebase_helper.go:409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) pkg/gui/controllers/local_commits_controller.go:704 — pkg/gui/controllers/local_commits_controller.go:704-711 | pkg/gui/controllers/sub_commits_controller.go:47-54 — 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/gui/controllers/local_commits_controller.go:704` it begins part-way through the construct above it, so those 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 · escapeInterpreter.parseOne (cyclomatic 69) · ×1
  • escapeInterpreter.parseOne (cyclomatic 69) pkg/gocui/escape.go:237 — escapeInterpreter.parseOne has cyclomatic complexity 69 (threshold 15). 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 · graph.getBoxDrawingChars (cyclomatic 65) · ×1
  • graph.getBoxDrawingChars (cyclomatic 65) pkg/gui/presentation/graph/cell.go:147 — graph.getBoxDrawingChars has cyclomatic complexity 65 (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 · Gui.onKey (cyclomatic 49) · ×1
  • Gui.onKey (cyclomatic 49) pkg/gocui/gui.go:1663 — Gui.onKey has cyclomatic complexity 49 (threshold 15). 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 · Gui.layout (cyclomatic 42) · ×1
  • Gui.layout (cyclomatic 42) pkg/gui/layout.go:13 — Gui.layout has cyclomatic complexity 42 (threshold 15). Of this number, 30 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 · RefreshHelper.performRefresh (cyclomatic 40) · ×1
  • RefreshHelper.performRefresh (cyclomatic 40) pkg/gui/controllers/helpers/refresh_helper.go:168 — RefreshHelper.performRefresh has cyclomatic complexity 40 (threshold 15). Of this number, 36 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: 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 · gocui.gocuiEventFromTcellEvent (cyclomatic 35) · ×1
  • gocui.gocuiEventFromTcellEvent (cyclomatic 35) pkg/gocui/tcell_driver.go:323 — gocui.gocuiEventFromTcellEvent has cyclomatic complexity 35 (threshold 15). 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 · ViewBufferManager.NewCmdTask (cyclomatic 33) · ×1
  • ViewBufferManager.NewCmdTask (cyclomatic 33) pkg/tasks/tasks.go:167 — ViewBufferManager.NewCmdTask has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to one function literal inside it that branches (line 168). 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 · graph.renderPipeSet (cyclomatic 31) · ×1
  • graph.renderPipeSet (cyclomatic 31) pkg/gui/presentation/graph/graph.go:275 — graph.renderPipeSet has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · config.KeyFromLabel (cyclomatic 29) · ×1
  • config.KeyFromLabel (cyclomatic 29) pkg/config/keynames.go:95 — config.KeyFromLabel 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 · presentation.getBranchDisplayStrings (cyclomatic 29) · ×1
  • presentation.getBranchDisplayStrings (cyclomatic 29) pkg/gui/presentation/branches.go:47 — presentation.getBranchDisplayStrings 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 · app.Start (cyclomatic 27) · ×1
  • app.Start (cyclomatic 27) pkg/app/entry_point.go:53 — app.Start 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 · Gui.execKeybindings (cyclomatic 27) · ×1
  • Gui.execKeybindings (cyclomatic 27) pkg/gocui/gui.go:1915 — Gui.execKeybindings has cyclomatic complexity 27 (threshold 15). 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 · graph.getNextPipes (cyclomatic 27) · ×1
  • graph.getNextPipes (cyclomatic 27) pkg/gui/presentation/graph/graph.go:109 — graph.getNextPipes has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · helpers.shrinkToContentSidePanelBoxes (cyclomatic 26) · ×1
  • helpers.shrinkToContentSidePanelBoxes (cyclomatic 26) pkg/gui/controllers/helpers/window_arrangement_helper.go:547 — helpers.shrinkToContentSidePanelBoxes 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 · Gui.draw (cyclomatic 25) · ×1
  • Gui.draw (cyclomatic 25) pkg/gocui/gui.go:1593 — Gui.draw has cyclomatic complexity 25 (threshold 15). 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 · presentation.displayCommit (cyclomatic 23) · ×1
  • presentation.displayCommit (cyclomatic 23) pkg/gui/presentation/commits.go:341 — presentation.displayCommit has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · escapeInterpreter.outputCSI (cyclomatic 22) · ×1
  • escapeInterpreter.outputCSI (cyclomatic 22) pkg/gocui/escape.go:481 — escapeInterpreter.outputCSI has cyclomatic complexity 22 (threshold 15). 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 · RefreshHelper.refreshStateFiles (cyclomatic 22) · ×1
  • RefreshHelper.refreshStateFiles (cyclomatic 22) pkg/gui/controllers/helpers/refresh_helper.go:1286 — RefreshHelper.refreshStateFiles has cyclomatic complexity 22 (threshold 15). Of this number, 16 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 · Gui.drawTitle (cyclomatic 21) · ×1
  • Gui.drawTitle (cyclomatic 21) pkg/gocui/gui.go:1374 — Gui.drawTitle has cyclomatic complexity 21 (threshold 15). 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 · WorktreeLoader.GetWorktrees (cyclomatic 20) · ×1
  • WorktreeLoader.GetWorktrees (cyclomatic 20) pkg/commands/git_commands/worktree_loader.go:24 — WorktreeLoader.GetWorktrees 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 · Gui.drawFrameEdges (cyclomatic 20) · ×1
  • Gui.drawFrameEdges (cyclomatic 20) pkg/gocui/gui.go:1194 — Gui.drawFrameEdges has cyclomatic complexity 20 (threshold 15). 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 · Gui.onNewRepo (cyclomatic 20) · ×1
  • Gui.onNewRepo (cyclomatic 20) pkg/gui/gui.go:342 — Gui.onNewRepo has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 373, 400, 427, …). 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 · Gui.drawFrameCorners (cyclomatic 19) · ×1
  • Gui.drawFrameCorners (cyclomatic 19) pkg/gocui/gui.go:1334 — Gui.drawFrameCorners has cyclomatic complexity 19 (threshold 15). 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 · View.draw (cyclomatic 19) · ×1
  • View.draw (cyclomatic 19) pkg/gocui/view.go:1322 — View.draw has cyclomatic complexity 19 (threshold 15). 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 · presentation.GetCommitListDisplayStrings (cyclomatic 19) · ×1
  • presentation.GetCommitListDisplayStrings (cyclomatic 19) pkg/gui/presentation/commits.go:40 — presentation.GetCommitListDisplayStrings has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · clients.RunTUI (cyclomatic 19) · ×1
  • clients.RunTUI (cyclomatic 19) pkg/integration/clients/tui.go:25 — clients.RunTUI has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 46, 58, 119, …). 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 · App.setupRepo (cyclomatic 18) · ×1
  • App.setupRepo (cyclomatic 18) pkg/app/app.go:194 — App.setupRepo 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.computeMigratedConfig (cyclomatic 18) · ×1
  • config.computeMigratedConfig (cyclomatic 18) pkg/config/app_config.go:277 — config.computeMigratedConfig 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 · patch_exploring.NewState (cyclomatic 18) · ×1
  • patch_exploring.NewState (cyclomatic 18) pkg/gui/patch_exploring/state.go:48 — patch_exploring.NewState 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 · WorkingTreeCommands.DiscardAllDirChanges (cyclomatic 17) · ×1
  • WorkingTreeCommands.DiscardAllDirChanges (cyclomatic 17) pkg/commands/git_commands/working_tree.go:190 — WorkingTreeCommands.DiscardAllDirChanges 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 one function literal inside it that branches (line 198). 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 · gocui.cornerCustomRune (cyclomatic 17) · ×1
  • gocui.cornerCustomRune (cyclomatic 17) pkg/gocui/gui.go:1274 — gocui.cornerCustomRune has cyclomatic complexity 17 (threshold 15). 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 · View.setCharacter (cyclomatic 17) · ×1
  • View.setCharacter (cyclomatic 17) pkg/gocui/view.go:619 — View.setCharacter has cyclomatic complexity 17 (threshold 15). 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 · View.write (cyclomatic 17) · ×1
  • View.write (cyclomatic 17) pkg/gocui/view.go:856 — View.write 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. 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 · helpers.infoSectionChildren (cyclomatic 17) · ×1
  • helpers.infoSectionChildren (cyclomatic 17) pkg/gui/controllers/helpers/window_arrangement_helper.go:280 — helpers.infoSectionChildren has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CommitLoader.getConflictedCommitImpl (cyclomatic 16) · ×1
  • CommitLoader.getConflictedCommitImpl (cyclomatic 16) pkg/commands/git_commands/commit_loader.go:405 — CommitLoader.getConflictedCommitImpl has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · config.migratePagersToDiffRenderers (cyclomatic 16) · ×1
  • config.migratePagersToDiffRenderers (cyclomatic 16) pkg/config/app_config.go:562 — config.migratePagersToDiffRenderers has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 563). 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 · config.validateCustomCommands (cyclomatic 16) · ×1
  • config.validateCustomCommands (cyclomatic 16) pkg/config/user_config_validation.go:194 — config.validateCustomCommands 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 · StagingHelper.RefreshStagingPanel (cyclomatic 16) · ×1
  • StagingHelper.RefreshStagingPanel (cyclomatic 16) pkg/gui/controllers/helpers/staging_helper.go:22 — StagingHelper.RefreshStagingPanel has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Gui.configureViewProperties (cyclomatic 16) · ×1
  • Gui.configureViewProperties (cyclomatic 16) pkg/gui/views.go:158 — Gui.configureViewProperties has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · utils.WrapViewLinesToWidth (cyclomatic 16) · ×1
  • utils.WrapViewLinesToWidth (cyclomatic 16) pkg/utils/lines.go:112 — utils.WrapViewLinesToWidth 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 · Gui.onKey (cognitive 94) · ×1
  • Gui.onKey (cognitive 94) pkg/gocui/gui.go:1663 — Gui.onKey has cognitive complexity 94 (threshold 15). Drivers by points: if/else 78, loops 8, boolean chains 7, match/switch 1 (nesting depth added 54). 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 · ViewBufferManager.NewCmdTask (cognitive 61) · ×1
  • ViewBufferManager.NewCmdTask (cognitive 61) pkg/tasks/tasks.go:167 — ViewBufferManager.NewCmdTask has cognitive complexity 61 (threshold 15). Drivers by points: if/else 36, match/switch 13, jumps 5, loops 5, boolean chains 2 (nesting depth added 29). Most of this is not in the body itself: 0 of the 61 points are its own statements and the rest belongs to one function literal inside it that branches (line 168). 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 · Gui.layout (cognitive 60) · ×1
  • Gui.layout (cognitive 60) pkg/gui/layout.go:13 — Gui.layout has cognitive complexity 60 (threshold 15). Drivers by points: if/else 46, boolean chains 7, loops 4, match/switch 2, jumps 1 (nesting depth added 18). Of this number, 45 points are the body's own statements and 15 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · escapeInterpreter.parseOne (cognitive 52) · ×1
  • escapeInterpreter.parseOne (cognitive 52) pkg/gocui/escape.go:237 — escapeInterpreter.parseOne has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29, boolean chains 12, match/switch 11 (nesting depth added 21). 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 · presentation.getBranchDisplayStrings (cognitive 50) · ×1
  • presentation.getBranchDisplayStrings (cognitive 50) pkg/gui/presentation/branches.go:47 — presentation.getBranchDisplayStrings has cognitive complexity 50 (threshold 15). Drivers by points: if/else 47, boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gocui.gocuiEventFromTcellEvent (cognitive 45) · ×1
  • gocui.gocuiEventFromTcellEvent (cognitive 45) pkg/gocui/tcell_driver.go:323 — gocui.gocuiEventFromTcellEvent has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27, match/switch 13, boolean chains 5 (nesting depth added 24). 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 · Gui.draw (cognitive 45) · ×1
  • Gui.draw (cognitive 45) pkg/gocui/gui.go:1593 — Gui.draw has cognitive complexity 45 (threshold 15). Drivers by points: if/else 40, boolean chains 5 (nesting depth added 19). 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 · RefreshHelper.performRefresh (cognitive 45) · ×1
  • RefreshHelper.performRefresh (cognitive 45) pkg/gui/controllers/helpers/refresh_helper.go:168 — RefreshHelper.performRefresh has cognitive complexity 45 (threshold 15). Drivers by points: if/else 34, boolean chains 9, loops 2 (nesting depth added 2). Of this number, 40 points are the body's own statements and 5 belong to one function literal inside it that branches. 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 · View.updateSearchPositions (cognitive 44) · ×1
  • View.updateSearchPositions (cognitive 44) pkg/gocui/view.go:1233 — View.updateSearchPositions has cognitive complexity 44 (threshold 15). Drivers by points: if/else 33, loops 11 (nesting depth added 27). Of this number, 28 points are the body's own statements and 16 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 · helpers.shrinkToContentSidePanelBoxes (cognitive 42) · ×1
  • helpers.shrinkToContentSidePanelBoxes (cognitive 42) pkg/gui/controllers/helpers/window_arrangement_helper.go:547 — helpers.shrinkToContentSidePanelBoxes has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24, loops 13, boolean chains 5 (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 · graph.getNextPipes (cognitive 40) · ×1
  • graph.getNextPipes (cognitive 40) pkg/gui/presentation/graph/graph.go:109 — graph.getNextPipes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 24, loops 13, boolean chains 3 (nesting depth added 13). Of this number, 30 points are the body's own statements and 10 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 · Gui.execKeybindings (cognitive 39) · ×1
  • Gui.execKeybindings (cognitive 39) pkg/gocui/gui.go:1915 — Gui.execKeybindings has cognitive complexity 39 (threshold 15). Drivers by points: if/else 33, boolean chains 5, loops 1 (nesting depth added 15). 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 · graph.renderPipeSet (cognitive 39) · ×1
  • graph.renderPipeSet (cognitive 39) pkg/gui/presentation/graph/graph.go:275 — graph.renderPipeSet has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19, loops 12, boolean chains 8 (nesting depth added 10). Of this number, 31 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RefreshHelper.refreshStateFiles (cognitive 38) · ×1
  • RefreshHelper.refreshStateFiles (cognitive 38) pkg/gui/controllers/helpers/refresh_helper.go:1286 — RefreshHelper.refreshStateFiles has cognitive complexity 38 (threshold 15). Drivers by points: if/else 31, boolean chains 4, loops 3 (nesting depth added 16). Of this number, 29 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 · config.KeyFromLabel (cognitive 36) · ×1
  • config.KeyFromLabel (cognitive 36) pkg/config/keynames.go:95 — config.KeyFromLabel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 29, boolean chains 4, match/switch 2, 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 · View.draw (cognitive 36) · ×1
  • View.draw (cognitive 36) pkg/gocui/view.go:1322 — View.draw has cognitive complexity 36 (threshold 15). Drivers by points: if/else 31, loops 3, boolean chains 2 (nesting depth added 17). 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 · app.Start (cognitive 35) · ×1
  • app.Start (cognitive 35) pkg/app/entry_point.go:53 — app.Start has cognitive complexity 35 (threshold 15). Drivers by points: if/else 33, boolean chains 2 (nesting depth added 9). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Gui.drawTitle (cognitive 35) · ×1
  • Gui.drawTitle (cognitive 35) pkg/gocui/gui.go:1374 — Gui.drawTitle has cognitive complexity 35 (threshold 15). Drivers by points: if/else 27, boolean chains 4, loops 4 (nesting depth added 13). 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 · presentation.GetCommitListDisplayStrings (cognitive 34) · ×1
  • presentation.GetCommitListDisplayStrings (cognitive 34) pkg/gui/presentation/commits.go:40 — presentation.GetCommitListDisplayStrings has cognitive complexity 34 (threshold 15). Drivers by points: if/else 29, boolean chains 4, loops 1 (nesting depth added 16). Of this number, 29 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Gui.drawFrameEdges (cognitive 33) · ×1
  • Gui.drawFrameEdges (cognitive 33) pkg/gocui/gui.go:1194 — Gui.drawFrameEdges has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25, boolean chains 6, loops 2 (nesting depth added 14). 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 · graph.getBoxDrawingChars (cognitive 32) · ×1
  • graph.getBoxDrawingChars (cognitive 32) pkg/gui/presentation/graph/cell.go:147 — graph.getBoxDrawingChars has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 16. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · config.loadUserConfig (cognitive 31) · ×1
  • config.loadUserConfig (cognitive 31) pkg/config/app_config.go:163 — config.loadUserConfig has cognitive complexity 31 (threshold 15). Drivers by points: if/else 27, match/switch 3, 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 · utils.WrapViewLinesToWidth (cognitive 31) · ×1
  • utils.WrapViewLinesToWidth (cognitive 31) pkg/utils/lines.go:112 — utils.WrapViewLinesToWidth has cognitive complexity 31 (threshold 15). Drivers by points: if/else 23, loops 7, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · App.setupRepo (cognitive 30) · ×1
  • App.setupRepo (cognitive 30) pkg/app/app.go:194 — App.setupRepo has cognitive complexity 30 (threshold 15). Drivers by points: if/else 28, 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 · View.write (cognitive 30) · ×1
  • View.write (cognitive 30) pkg/gocui/view.go:856 — View.write has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 2, match/switch 2 (nesting depth added 15). Of this number, 29 points are the body's own statements and 1 belongs 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 · FixupHelper.blameAddedLines (cognitive 30) · ×1
  • FixupHelper.blameAddedLines (cognitive 30) pkg/gui/controllers/helpers/fixup_helper.go:300 — FixupHelper.blameAddedLines has cognitive complexity 30 (threshold 15). Drivers by points: if/else 27, loops 2, boolean chains 1 (nesting depth added 13). Of this number, 17 points are the body's own statements and 13 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 · WorktreeLoader.GetWorktrees (cognitive 29) · ×1
  • WorktreeLoader.GetWorktrees (cognitive 29) pkg/commands/git_commands/worktree_loader.go:24 — WorktreeLoader.GetWorktrees has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23, loops 5, boolean chains 1 (nesting depth added 10). 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 · Gui.onNewRepo (cognitive 29) · ×1
  • Gui.onNewRepo (cognitive 29) pkg/gui/gui.go:342 — Gui.onNewRepo has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 373, 400, 427, …). 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 · BranchLoader.Load (cognitive 28) · ×1
  • BranchLoader.Load (cognitive 28) pkg/commands/git_commands/branch_loader.go:67 — BranchLoader.Load has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19, loops 7, boolean chains 1, jumps 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 · config.validateCustomCommands (cognitive 27) · ×1
  • config.validateCustomCommands (cognitive 27) pkg/config/user_config_validation.go:194 — config.validateCustomCommands has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, loops 4, 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 · presentation.displayCommit (cognitive 26) · ×1
  • presentation.displayCommit (cognitive 26) pkg/gui/presentation/commits.go:341 — presentation.displayCommit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · HandlerCreator.call (cognitive 26) · ×1
  • HandlerCreator.call (cognitive 26) pkg/gui/services/custom_commands/handler_creator.go:47 — HandlerCreator.call has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, match/switch 2, loops 1 (nesting depth added 16). Most of this is not in the body itself: 0 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 48). 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 · WorkingTreeCommands.DiscardAllDirChanges (cognitive 25) · ×1
  • WorkingTreeCommands.DiscardAllDirChanges (cognitive 25) pkg/commands/git_commands/working_tree.go:190 — WorkingTreeCommands.DiscardAllDirChanges has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 2 (nesting depth added 9). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 198). 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 · oscommands.CopyDir (cognitive 25) · ×1
  • oscommands.CopyDir (cognitive 25) pkg/commands/oscommands/copy.go:80 — oscommands.CopyDir has cognitive complexity 25 (threshold 15). Drivers by points: if/else 23, boolean chains 1, loops 1 (nesting depth added 10). 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 · config.changeCustomCommandStreamAndOutputToOutputEnum (cognitive 25) · ×1
  • config.changeCustomCommandStreamAndOutputToOutputEnum (cognitive 25) pkg/config/app_config.go:431 — config.changeCustomCommandStreamAndOutputToOutputEnum has cognitive complexity 25 (threshold 15). Drivers by points: if/else 21, boolean chains 4 (nesting depth added 10). Most of this is not in the body itself: 0 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 432). 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.migratePagersToDiffRenderers (cognitive 24) · ×1
  • config.migratePagersToDiffRenderers (cognitive 24) pkg/config/app_config.go:562 — config.migratePagersToDiffRenderers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, boolean chains 4, loops 1 (nesting depth added 7). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 563). 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 · patchTransformer.transformHunkLines (cognitive 23) · ×1
  • patchTransformer.transformHunkLines (cognitive 23) pkg/commands/patch/transform.go:172 — patchTransformer.transformHunkLines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18, boolean chains 4, 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 · View.setCharacter (cognitive 23) · ×1
  • View.setCharacter (cognitive 23) pkg/gocui/view.go:619 — View.setCharacter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 20, boolean chains 3 (nesting depth added 7). 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 · UndoController.parseReflogForActions (cognitive 23) · ×1
  • UndoController.parseReflogForActions (cognitive 23) pkg/gui/controllers/undo_controller.go:200 — UndoController.parseReflogForActions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 21, 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 · WorkingTreeCommands.removeEmptyDirs (cognitive 22) · ×1
  • WorkingTreeCommands.removeEmptyDirs (cognitive 22) pkg/commands/git_commands/working_tree.go:294 — WorkingTreeCommands.removeEmptyDirs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 2 (nesting depth added 12). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.computeMigratedConfig (cognitive 21) · ×1
  • config.computeMigratedConfig (cognitive 21) pkg/config/app_config.go:277 — config.computeMigratedConfig has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · gocui.lineWrap (cognitive 21) · ×1
  • gocui.lineWrap (cognitive 21) pkg/gocui/view.go:1686 — gocui.lineWrap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15, loops 5, boolean chains 1 (nesting depth added 9). 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 · app.layout (cognitive 21) · ×1
  • app.layout (cognitive 21) pkg/integration/clients/tui.go:275 — app.layout has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21 (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 · FileLoader.GetStatusFiles (cognitive 20) · ×1
  • FileLoader.GetStatusFiles (cognitive 20) pkg/commands/git_commands/file_loader.go:47 — FileLoader.GetStatusFiles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, loops 4, 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 · WorkingTreeCommands.DiscardAllFileChanges (cognitive 20) · ×1
  • WorkingTreeCommands.DiscardAllFileChanges (cognitive 20) pkg/commands/git_commands/working_tree.go:123 — WorkingTreeCommands.DiscardAllFileChanges has cognitive complexity 20 (threshold 15). Drivers by points: if/else 18, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cmdObjRunner.processOutput (cognitive 20) · ×1
  • cmdObjRunner.processOutput (cognitive 20) pkg/commands/oscommands/cmd_obj_runner.go:382 — cmdObjRunner.processOutput has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, 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 · config.validateKeybindingsRecurse (cognitive 20) · ×1
  • config.validateKeybindingsRecurse (cognitive 20) pkg/config/user_config_validation.go:146 — config.validateKeybindingsRecurse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gocui.contentToCells (cognitive 20) · ×1
  • gocui.contentToCells (cognitive 20) pkg/gocui/text_area.go:63 — gocui.contentToCells has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 6, boolean chains 3 (nesting depth added 8). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · View.refreshViewLinesIfNeeded (cognitive 20) · ×1
  • View.refreshViewLinesIfNeeded (cognitive 20) pkg/gocui/view.go:1420 — View.refreshViewLinesIfNeeded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, loops 3, boolean chains 1 (nesting depth added 9). 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 · ContextMgr.pushToContextStack (cognitive 20) · ×1
  • ContextMgr.pushToContextStack (cognitive 20) pkg/gui/context.go:76 — ContextMgr.pushToContextStack has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · helpers.infoSectionChildren (cognitive 20) · ×1
  • helpers.infoSectionChildren (cognitive 20) pkg/gui/controllers/helpers/window_arrangement_helper.go:280 — helpers.infoSectionChildren has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ViewDriver.assertLines (cognitive 20) · ×1
  • ViewDriver.assertLines (cognitive 20) pkg/integration/components/view_driver.go:230 — ViewDriver.assertLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 8). Of this number, 13 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 · SubmoduleCommands.GetConfigs (cognitive 19) · ×1
  • SubmoduleCommands.GetConfigs (cognitive 19) pkg/commands/git_commands/submodule.go:30 — SubmoduleCommands.GetConfigs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, 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 · cmdObjRunner.runAndStreamAux (cognitive 19) · ×1
  • cmdObjRunner.runAndStreamAux (cognitive 19) pkg/commands/oscommands/cmd_obj_runner.go:234 — cmdObjRunner.runAndStreamAux has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19 (nesting depth added 5). 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 · Gui.drawFrameCorners (cognitive 19) · ×1
  • Gui.drawFrameCorners (cognitive 19) pkg/gocui/gui.go:1334 — Gui.drawFrameCorners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 8). 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 · filetree.BuildTreeFromCommitFiles (cognitive 19) · ×1
  • filetree.BuildTreeFromCommitFiles (cognitive 19) pkg/gui/filetree/build_tree.go:81 — filetree.BuildTreeFromCommitFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, loops 6, jumps 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 · patch_exploring.NewState (cognitive 19) · ×1
  • patch_exploring.NewState (cognitive 19) pkg/gui/patch_exploring/state.go:48 — patch_exploring.NewState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · config.LabelForKey (cognitive 18) · ×1
  • config.LabelForKey (cognitive 18) pkg/config/keynames.go:50 — config.LabelForKey has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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 · escapeInterpreter.csiColor (cognitive 18) · ×1
  • escapeInterpreter.csiColor (cognitive 18) pkg/gocui/escape.go:542 — escapeInterpreter.csiColor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, match/switch 1 (nesting depth added 8). 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 · helpers.sidePanelChildren (cognitive 18) · ×1
  • helpers.sidePanelChildren (cognitive 18) pkg/gui/controllers/helpers/window_arrangement_helper.go:435 — helpers.sidePanelChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 2, loops 1 (nesting depth added 6). 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 436). 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 · ReposHelper.getCurrentBranch (cognitive 18) · ×1
  • ReposHelper.getCurrentBranch (cognitive 18) pkg/gui/controllers/helpers/repos_helper.go:62 — ReposHelper.getCurrentBranch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18 (nesting depth added 9). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StagingHelper.RefreshStagingPanel (cognitive 18) · ×1
  • StagingHelper.RefreshStagingPanel (cognitive 18) pkg/gui/controllers/helpers/staging_helper.go:22 — StagingHelper.RefreshStagingPanel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SuggestionsHelper.GetFilePathSuggestionsFunc (cognitive 18) · ×1
  • SuggestionsHelper.GetFilePathSuggestionsFunc (cognitive 18) pkg/gui/controllers/helpers/suggestions_helper.go:121 — SuggestionsHelper.GetFilePathSuggestionsFunc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, loops 5 (nesting depth added 9). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 122, 157). 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 · filetree.BuildTreeFromFiles (cognitive 18) · ×1
  • filetree.BuildTreeFromFiles (cognitive 18) pkg/gui/filetree/build_tree.go:10 — filetree.BuildTreeFromFiles has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, loops 3, jumps 2, 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 · Client.showCustomCommandsMenu (cognitive 18) · ×1
  • Client.showCustomCommandsMenu (cognitive 18) pkg/gui/services/custom_commands/client.go:66 — Client.showCustomCommandsMenu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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 · HandlerCreator.finalHandler (cognitive 18) · ×1
  • HandlerCreator.finalHandler (cognitive 18) pkg/gui/services/custom_commands/handler_creator.go:288 — HandlerCreator.finalHandler has cognitive complexity 18 (threshold 15). Drivers by points: if/else 16, boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 306). 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 · clients.RunTUI (cognitive 18) · ×1
  • clients.RunTUI (cognitive 18) pkg/integration/clients/tui.go:25 — clients.RunTUI has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 46, 58, 119, …). 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 · RebaseCommands.DiscardOldFileChanges (cognitive 17) · ×1
  • RebaseCommands.DiscardOldFileChanges (cognitive 17) pkg/commands/git_commands/rebase.go:520 — RebaseCommands.DiscardOldFileChanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, 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 · escapeInterpreter.outputCSI (cognitive 17) · ×1
  • escapeInterpreter.outputCSI (cognitive 17) pkg/gocui/escape.go:481 — escapeInterpreter.outputCSI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 6, match/switch 2, loops 1 (nesting depth added 6). 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 · BackgroundRoutineMgr.startBackgroundRoutines (cognitive 17) · ×1
  • BackgroundRoutineMgr.startBackgroundRoutines (cognitive 17) pkg/gui/background.go:42 — BackgroundRoutineMgr.startBackgroundRoutines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 5). Of this number, 13 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 · Gui.RunAndHandleError (cognitive 17) · ×1
  • Gui.RunAndHandleError (cognitive 17) pkg/gui/gui.go:1000 — Gui.RunAndHandleError has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, loops 2 (nesting depth added 10). 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 1002). 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 · theme.GetTextStyle (cognitive 17) · ×1
  • theme.GetTextStyle (cognitive 17) pkg/theme/style.go:9 — theme.GetTextStyle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, 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 · PatchCommands.MovePatchToSelectedCommit (cognitive 16) · ×1
  • PatchCommands.MovePatchToSelectedCommit (cognitive 16) pkg/commands/git_commands/patch.go:116 — PatchCommands.MovePatchToSelectedCommit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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 · PatchCommands.MovePatchIntoIndex (cognitive 16) · ×1
  • PatchCommands.MovePatchIntoIndex (cognitive 16) pkg/commands/git_commands/patch.go:220 — PatchCommands.MovePatchIntoIndex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16 (nesting depth added 4). Of this number, 10 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OSCommand.PipeCommands (cognitive 16) · ×1
  • OSCommand.PipeCommands (cognitive 16) pkg/commands/oscommands/os.go:205 — OSCommand.PipeCommands has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, loops 2 (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 237). 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 · Gui.processRemainingEvents (cognitive 16) · ×1
  • Gui.processRemainingEvents (cognitive 16) pkg/gocui/gui.go:1107 — Gui.processRemainingEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, match/switch 2, boolean chains 1, loops 1 (nesting depth added 9). 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 · TextArea.SetCursor2D (cognitive 16) · ×1
  • TextArea.SetCursor2D (cognitive 16) pkg/gocui/text_area.go:622 — TextArea.SetCursor2D 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 · View.Read (cognitive 16) · ×1
  • View.Read (cognitive 16) pkg/gocui/view.go:1088 — View.Read has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, loops 3 (nesting depth added 9). 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 · context.NewLocalCommitsContext (cognitive 16) · ×1
  • context.NewLocalCommitsContext (cognitive 16) pkg/gui/context/local_commits_context.go:39 — context.NewLocalCommitsContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 80, 46). 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 · controllers.getExplodeImage (cognitive 16) · ×1
  • controllers.getExplodeImage (cognitive 16) pkg/gui/controllers/workspace_reset_controller.go:227 — controllers.getExplodeImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, 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 · MergeAndRebaseHelper.genericMergeCommandImpl (cognitive 16) · ×1
  • MergeAndRebaseHelper.genericMergeCommandImpl (cognitive 16) pkg/gui/controllers/helpers/merge_and_rebase_helper.go:97 — MergeAndRebaseHelper.genericMergeCommandImpl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6 (nesting depth added 3). 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 · presentation.getFileLine (cognitive 16) · ×1
  • presentation.getFileLine (cognitive 16) pkg/gui/presentation/files.go:112 — presentation.getFileLine has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, 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 · ViewDriver.ContainsLines (cognitive 16) · ×1
  • ViewDriver.ContainsLines (cognitive 16) pkg/integration/components/view_driver.go:98 — ViewDriver.ContainsLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 102). 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 · utils.excludeBlankColumns (cognitive 16) · ×1
  • utils.excludeBlankColumns (cognitive 16) pkg/utils/formatting.go:90 — utils.excludeBlankColumns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, loops 7, boolean chains 1, jumps 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.
D31 · IaC & Container Security · Medium IaC · ×1
  • Medium IaC: CKV_DOCKER_3 Dockerfile:1 — Ensure that a user for the container has been created
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. 23 floating ref(s) across 5 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 — 2 workflow(s) triggered by pull_request declare no `permissions:` block (ci.yml, check-required-label.yml) and so run with the repository's default GITHUB_TOKEN scope, while 2 sibling workflows in the same repository are 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.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) pkg/gui/controllers/submodules_controller.go:229 — pkg/gui/controllers/submodules_controller.go:229-242 | pkg/gui/controllers/submodules_controller.go:244-257 | pkg/gui/controllers/submodules_controller.go:259-272 — 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/gui/controllers/submodules_controller.go:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×1
  • Duplicated block (12 lines × 2) pkg/gui/controllers/custom_patch_options_menu_action.go:177 — pkg/gui/controllers/custom_patch_options_menu_action.go:177-188 | pkg/gui/controllers/custom_patch_options_menu_action.go:212-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/gui/controllers/custom_patch_options_menu_action.go:177` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Recommendation — 15 finding(s)
D29 · Static Analysis (SAST) · Low · ×7
  • Low: use-of-unsafe-block pkg/commands/oscommands/pty_windows.go:246 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site uses only the compile-time size/layout operators (`unsafe.Sizeof`/`Alignof`/`Offsetof`). They evaluate to a constant and dereference nothing, so this row records that the package is imported here, not that memory is being handled unsafely.
  • Low: use-of-unsafe-block pkg/commands/oscommands/pty_windows.go:356 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site converts an `unsafe.Pointer` to `uintptr` but does no arithmetic on the result. That is the form Go's `unsafe.Pointer` rules permit for handing an address to a system or foreign call, and it is valid provided the conversion stays inside the call expression rather than being stored in a variable first — which is what `go vet`'s `unsafeptr` pass checks. Keep that pass on the package so a later edit that lifts the `uintptr` into a local, or starts doing arithmetic on it, is caught.
  • Low: use-of-unsafe-block pkg/commands/oscommands/pty_windows.go:377 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site reinterprets a memory region as another type. The conversion itself is checked by nothing, so it is correct only while the region is at least as large as the target type and correctly aligned for it — assert that before the conversion wherever the length or the offset comes from data this process did not produce.
  • Low: use-of-unsafe-block pkg/commands/oscommands/pty_windows.go:378 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site uses only the compile-time size/layout operators (`unsafe.Sizeof`/`Alignof`/`Offsetof`). They evaluate to a constant and dereference nothing, so this row records that the package is imported here, not that memory is being handled unsafely.
  • Low: use-of-unsafe-block pkg/commands/oscommands/pty_windows.go:384 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site uses only the compile-time size/layout operators (`unsafe.Sizeof`/`Alignof`/`Offsetof`). They evaluate to a constant and dereference nothing, so this row records that the package is imported here, not that memory is being handled unsafely.
  • Low: use-of-unsafe-block pkg/gocui/gui_others.go:40 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site converts an `unsafe.Pointer` to `uintptr` but does no arithmetic on the result. That is the form Go's `unsafe.Pointer` rules permit for handing an address to a system or foreign call, and it is valid provided the conversion stays inside the call expression rather than being stored in a variable first — which is what `go vet`'s `unsafeptr` pass checks. Keep that pass on the package so a later edit that lifts the `uintptr` into a local, or starts doing arithmetic on it, is caught.
  • Low: use-of-unsafe-block pkg/gocui/gui_windows.go:48 — Using the unsafe package in Go gives you low-level memory management and many of the strengths of the C language, but also steps around the type safety of Go and can lead to buffer overflows and possible arbitrary code execution by an attacker. Only use this package if you absolutely know what you're doing. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is. This site converts an `unsafe.Pointer` to `uintptr` but does no arithmetic on the result. That is the form Go's `unsafe.Pointer` rules permit for handing an address to a system or foreign call, and it is valid provided the conversion stays inside the call expression rather than being stored in a variable first — which is what `go vet`'s `unsafeptr` pass checks. Keep that pass on the package so a later edit that lifts the `uintptr` into a local, or starts doing arithmetic on it, is caught.
D11 · Test Reliability · Test reliability not included · ×1
  • Test reliability not included — Test source is present (.go) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 120 significant file(s) lose their only recent owner: pkg/gui/controllers/helpers/refresh_helper.go, pkg/gui/controllers/local_commits_controller.go, pkg/gocui/gui.go, pkg/gocui/view.go, pkg/gui/controllers/branches_controller.go, pkg/gui/controllers/helpers/merge_and_rebase_helper.go, pkg/integration/components/view_driver.go, pkg/gui/controllers/helpers/refs_helper.go (+112 more). Pair on, review, or document these before any departure.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 19 of 229 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — largest first: pkg/integration/components/random.go, pkg/updates/updates.go, pkg/gui/context/context.go (and 16 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · No build provenance · ×1
  • No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing · No artifact signing · ×1
  • No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them, a `signs:` block in `.goreleaser.yml` (cosign keyless or GPG over the checksums file), which GoReleaser then runs for every release artifact) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing · No SBOM · ×1
  • No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (an `sboms:` block in `.goreleaser.yml`, which GoReleaser runs on the release you already cut and attaches the document beside the artifacts, `cyclonedx-gomod` over the module graph — or Go's own build info, which already records the module set in the binary, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
D38 · OSV Dependency Vulnerabilities · Scanner failed to run · ×1
  • Scanner failed to run — not a clean result — osv-scanner exited 128 with no findings — dependency CVEs were not measured. The scanner exited non-zero and produced no findings because it found no package sources to scan — no lockfile it can resolve is committed to this repository (a manifest alone does not pin versions, so there is nothing to match advisories against). Commit the lockfile your package manager already produces, or generate one in CI before the scan, so this is reported as a measurement gap rather than a clean pass.
D8 · Code Coverage · Coverage not included · ×1
  • Coverage not included — suite not readable by the collector — Coverage NOT READ here — but this repository measures it: a coverage step in CI (`go test ./... -short -cover`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.go), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, 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.
Info — 2 finding(s)
D12 · Dependency Hygiene · Dependency hygiene not measured · ×1
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifest (a Go module (go.mod/go.sum)) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable.
D22 · Internal API Consistency · No exposed public API · ×1
  • No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaksgitleaks detect --no-banner --report-format json --report-path /dev/stdout --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D29 · Static Analysis (SAST)semgrepsemgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --json --quiet --timeout 0 --metrics off .38artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)none (no readable dependency manifest): not present in this environment0
D31 · IaC & Container Securitytrivytrivy config --format json --quiet .2artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrepsemgrep: not applicable — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.0
D33 · JS/npm Dependency Vulnerabilitiestrivytrivy: not applicable — 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.0
D37 · Vulnerability-disclosure Policydisclosuredisclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner --format json --recursive .0
D40 · Network Egress Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0
D41 · Kernel & Syscall Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0
D42 · Runtime Threat Enforcementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0

Run 019fd560-8c22-77a5-90e2-7f24e3b37a78 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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