Public report of go-delve/delve, published 24 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 24 October 2026, 02:44 UTC · Survey ID cd_d42aa22683fa43ce87618fa85dfaec6d
go-delve/delve
Measured 24 October 2026, 02:41 UTC, at code version a439ae6
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A medium codebase: 75,937 lines of product code in 1 project, tests not counted · Estimated rebuild effort: about 1.1 person-years · Weakest lens: Maturity, 62
Findings by how serious they are
1 critical717 serious188 minor
21 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
24 October 2026, 02:41 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
52of 55 dimensions measured by tools. The other 3 are advisory notes from an AI model, which explain the code but don't count towards the score.
886of 906 findings point to an exact file and line, so you can open each one in the code. The other 20 concern the repository as a whole, such as missing documentation.
55dimensions across 6 lenses, read from 75,937 lines of product code in 1 project.
go-delve/delve scores 67 out of 100 and is rated Adequate, while four of its six lenses score higher still: Architecture at 84 and Security and Compliance at 76, both rated Adequate, and Performance at 80 and Production Readiness at 73, both rated Strong.
The score is lower than those four because the weakest lens counts most, and here that is Maturity, which scores 62 and is rated Adequate. Its Architecture documentation dimension scores 2 out of 10, and until that reaches 4, Maturity can't be rated higher than Adequate. The first actions are to resolve the 1 No ADRs found finding(s) in ADR Quality and to record your significant design decisions, and if Maturity rose to 70, the score would rise from 67 to about 69.
One finding is critical, in Test Reliability.
Watchdog couldn't measure 20 dimensions in this code, among them Code Coverage, License Compliance and Internal API Consistency, so they are left out of the score. The product code is 75,937 lines, which would take an estimated 1.1 person-years, around €160,000, to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Maturity rose from 62 to 70, the lowest score rated Strong, the score would rise from 67 to about 69.
Code composition: what the lines of code are
Product code 71%Tests 29%
New since the last survey: 1 finding
This critical or serious finding wasn't in the previous survey, on 10 October 2026.
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 27 findings
These 27 critical or serious findings were in the previous survey, on 10 October 2026, and are gone from this one.
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/proc/linutil/auxv.go
Exception handling · Swallowed exception (caught, then discarded) pkg/proc/linutil/auxv.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/proc/native/proc_linux.go
Exception handling · Swallowed exception (caught, then discarded) pkg/proc/native/proc_linux.go
Exception handling · Swallowed exception (caught, then discarded) REDACTED
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/terminal_windows.go
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/terminal_windows.go
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/terminal.go
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/starbind/conv.go
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/starbind/conv.go
Exception handling · Swallowed exception (caught, then discarded) pkg/terminal/starbind/conv.go
Exception handling · Swallowed exception (caught, then discarded) service/dap/server.go
Exception handling · Swallowed exception (caught, then discarded) service/dap/server.go
Exception handling · Swallowed exception (caught, then discarded) service/debugger/debugger_linux.go
Exception handling · Swallowed exception (caught, then discarded) service/debugger/debugger_linux.go
Exception handling · Swallowed exception (caught, then discarded) service/debugger/debugger.go
Exception handling · Swallowed exception (caught, then discarded) service/rpc2/client.go
Rebuild cost: about €160,000 · Estimate
Cost to rebuild
€52,000 to €260,000, for 863 to 2,737 hours of work, about 1.1 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.9 at a score of 67. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 75,937 lines of product code
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Raises the score by about 4 points · Low effort · ADR Quality
2
Record your significant design decisions.
Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €160,000 to build again, about 1.1 person-years of work. Its weakest lens is Maturity, at 62 (Adequate). Maturity is about how well the project explains and looks after itself, which decides whether a new developer, or a new supplier, can take over. Because the weakest lens counts most in the score, work on Maturity also moves the score most.
Based on: the rebuild estimate · the Maturity grade · how much each lens counts
What to do: Start with the Maturity actions in Top priorities.
If you do one thing first · First action
Resolve the 1 No ADRs found finding(s) in ADR Quality. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 ADR Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.1 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 2,282 lines over the last 90 days, which is about 9,255 lines a year. At that pace, the extra work comes to an estimated 1.1 to 6.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
50 modules, with 87 dependencies between them. Every module uses only modules listed above it, so there are no loops.
The table shows the 40 modules with the most connections; 10 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
github.com/go-delve/delve/pkg/dwarf/frame uses github.com/go-delve/delve/pkg/dwarf/leb128, so a change to github.com/go-delve/delve/pkg/dwarf/leb128 can break github.com/go-delve/delve/pkg/dwarf/frame, while a change to github.com/go-delve/delve/pkg/dwarf/frame can't break github.com/go-delve/delve/pkg/dwarf/leb128.
Position
Below the diagonal: github.com/go-delve/delve/pkg/dwarf/frame uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/dwarf/loclist uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/pkg/dwarf/loclist, while a change to github.com/go-delve/delve/pkg/dwarf/loclist can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/dwarf/loclist uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/dwarf/reader uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/pkg/dwarf/reader, while a change to github.com/go-delve/delve/pkg/dwarf/reader can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/dwarf/reader uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/evalop uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/pkg/proc/evalop, while a change to github.com/go-delve/delve/pkg/proc/evalop can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/evalop uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/internal/ebpf uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/pkg/proc/internal/ebpf, while a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/internal/ebpf uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/internal/ebpf uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/internal/ebpf, while a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/internal/ebpf uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/line, so a change to github.com/go-delve/delve/pkg/dwarf/line can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/line.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/elfwriter, so a change to github.com/go-delve/delve/pkg/elfwriter can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/elfwriter.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/internal/lru, so a change to github.com/go-delve/delve/pkg/internal/lru can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/internal/lru.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/logflags, so a change to github.com/go-delve/delve/pkg/logflags can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/logflags.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/frame, so a change to github.com/go-delve/delve/pkg/dwarf/frame can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/frame.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/loclist, so a change to github.com/go-delve/delve/pkg/dwarf/loclist can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/loclist.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/dwarf/reader, so a change to github.com/go-delve/delve/pkg/dwarf/reader can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/dwarf/reader.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/proc/evalop, so a change to github.com/go-delve/delve/pkg/proc/evalop can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/proc/evalop.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc uses github.com/go-delve/delve/pkg/proc/internal/ebpf, so a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can break github.com/go-delve/delve/pkg/proc, while a change to github.com/go-delve/delve/pkg/proc can't break github.com/go-delve/delve/pkg/proc/internal/ebpf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/amd64util uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/amd64util, while a change to github.com/go-delve/delve/pkg/proc/amd64util can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/amd64util uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/winutil uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/winutil, while a change to github.com/go-delve/delve/pkg/proc/winutil can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/winutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/winutil uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/winutil, while a change to github.com/go-delve/delve/pkg/proc/winutil can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/winutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/api uses github.com/go-delve/delve/pkg/dwarf/godwarf, so a change to github.com/go-delve/delve/pkg/dwarf/godwarf can break github.com/go-delve/delve/service/api, while a change to github.com/go-delve/delve/service/api can't break github.com/go-delve/delve/pkg/dwarf/godwarf.
Position
Below the diagonal: github.com/go-delve/delve/service/api uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/api uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/service/api, while a change to github.com/go-delve/delve/service/api can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/service/api uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/api uses github.com/go-delve/delve/pkg/goversion, so a change to github.com/go-delve/delve/pkg/goversion can break github.com/go-delve/delve/service/api, while a change to github.com/go-delve/delve/service/api can't break github.com/go-delve/delve/pkg/goversion.
Position
Below the diagonal: github.com/go-delve/delve/service/api uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/api uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/service/api, while a change to github.com/go-delve/delve/service/api can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/service/api uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/config uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/pkg/config, while a change to github.com/go-delve/delve/pkg/config can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/pkg/config uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/locspec uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/locspec, while a change to github.com/go-delve/delve/pkg/locspec can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/locspec uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/locspec uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/pkg/locspec, while a change to github.com/go-delve/delve/pkg/locspec can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/pkg/locspec uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core/minidump uses github.com/go-delve/delve/pkg/proc/winutil, so a change to github.com/go-delve/delve/pkg/proc/winutil can break github.com/go-delve/delve/pkg/proc/core/minidump, while a change to github.com/go-delve/delve/pkg/proc/core/minidump can't break github.com/go-delve/delve/pkg/proc/winutil.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core/minidump uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/fbsdutil uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/fbsdutil, while a change to github.com/go-delve/delve/pkg/proc/fbsdutil can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/fbsdutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/fbsdutil uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/fbsdutil, while a change to github.com/go-delve/delve/pkg/proc/fbsdutil can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/fbsdutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/fbsdutil uses github.com/go-delve/delve/pkg/proc/amd64util, so a change to github.com/go-delve/delve/pkg/proc/amd64util can break github.com/go-delve/delve/pkg/proc/fbsdutil, while a change to github.com/go-delve/delve/pkg/proc/fbsdutil can't break github.com/go-delve/delve/pkg/proc/amd64util.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/fbsdutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/linutil uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/linutil, while a change to github.com/go-delve/delve/pkg/proc/linutil can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/linutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/linutil uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/linutil, while a change to github.com/go-delve/delve/pkg/proc/linutil can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/linutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/linutil uses github.com/go-delve/delve/pkg/proc/amd64util, so a change to github.com/go-delve/delve/pkg/proc/amd64util can break github.com/go-delve/delve/pkg/proc/linutil, while a change to github.com/go-delve/delve/pkg/proc/linutil can't break github.com/go-delve/delve/pkg/proc/amd64util.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/linutil uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/elfwriter, so a change to github.com/go-delve/delve/pkg/elfwriter can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/elfwriter.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/proc/internal/ebpf, so a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/proc/internal/ebpf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
35 pairs of types, where a type in github.com/go-delve/delve/pkg/proc/core uses a type in github.com/go-delve/delve/pkg/proc. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/proc/core/minidump, so a change to github.com/go-delve/delve/pkg/proc/core/minidump can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/proc/core/minidump.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/core uses github.com/go-delve/delve/pkg/proc/linutil, so a change to github.com/go-delve/delve/pkg/proc/linutil can break github.com/go-delve/delve/pkg/proc/core, while a change to github.com/go-delve/delve/pkg/proc/core can't break github.com/go-delve/delve/pkg/proc/linutil.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/core uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/debugger uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/service/debugger, while a change to github.com/go-delve/delve/service/debugger can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/service/debugger uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/debugger uses github.com/go-delve/delve/pkg/logflags, so a change to github.com/go-delve/delve/pkg/logflags can break github.com/go-delve/delve/service/debugger, while a change to github.com/go-delve/delve/service/debugger can't break github.com/go-delve/delve/pkg/logflags.
Position
Below the diagonal: github.com/go-delve/delve/service/debugger uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/debugger uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/service/debugger, while a change to github.com/go-delve/delve/service/debugger can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/service/debugger uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/debugger uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/service/debugger, while a change to github.com/go-delve/delve/service/debugger can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/service/debugger uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/debugger uses github.com/go-delve/delve/pkg/locspec, so a change to github.com/go-delve/delve/pkg/locspec can break github.com/go-delve/delve/service/debugger, while a change to github.com/go-delve/delve/service/debugger can't break github.com/go-delve/delve/pkg/locspec.
Position
Below the diagonal: github.com/go-delve/delve/service/debugger uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/cmd/dlv/cmds uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/cmd/dlv/cmds, while a change to github.com/go-delve/delve/cmd/dlv/cmds can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/cmd/dlv/cmds uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/cmd/dlv/cmds uses github.com/go-delve/delve/pkg/config, so a change to github.com/go-delve/delve/pkg/config can break github.com/go-delve/delve/cmd/dlv/cmds, while a change to github.com/go-delve/delve/cmd/dlv/cmds can't break github.com/go-delve/delve/pkg/config.
Position
Below the diagonal: github.com/go-delve/delve/cmd/dlv/cmds uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/cmd/dlv/cmds uses github.com/go-delve/delve/service/debugger, so a change to github.com/go-delve/delve/service/debugger can break github.com/go-delve/delve/cmd/dlv/cmds, while a change to github.com/go-delve/delve/cmd/dlv/cmds can't break github.com/go-delve/delve/service/debugger.
Position
Below the diagonal: github.com/go-delve/delve/cmd/dlv/cmds uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/elfwriter, so a change to github.com/go-delve/delve/pkg/elfwriter can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/elfwriter.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/goversion, so a change to github.com/go-delve/delve/pkg/goversion can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/goversion.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/logflags, so a change to github.com/go-delve/delve/pkg/logflags can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/logflags.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/proc/internal/ebpf, so a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/proc/internal/ebpf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
33 pairs of types, where a type in github.com/go-delve/delve/pkg/proc/gdbserial uses a type in github.com/go-delve/delve/pkg/proc. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/gdbserial uses github.com/go-delve/delve/pkg/proc/core, so a change to github.com/go-delve/delve/pkg/proc/core can break github.com/go-delve/delve/pkg/proc/gdbserial, while a change to github.com/go-delve/delve/pkg/proc/gdbserial can't break github.com/go-delve/delve/pkg/proc/core.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/gdbserial uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/dwarf/op, so a change to github.com/go-delve/delve/pkg/dwarf/op can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/dwarf/op.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/elfwriter, so a change to github.com/go-delve/delve/pkg/elfwriter can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/elfwriter.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc/internal/ebpf, so a change to github.com/go-delve/delve/pkg/proc/internal/ebpf can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc/internal/ebpf.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
31 pairs of types, where a type in github.com/go-delve/delve/pkg/proc/native uses a type in github.com/go-delve/delve/pkg/proc. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc/amd64util, so a change to github.com/go-delve/delve/pkg/proc/amd64util can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc/amd64util.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc/winutil, so a change to github.com/go-delve/delve/pkg/proc/winutil can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc/winutil.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc/linutil, so a change to github.com/go-delve/delve/pkg/proc/linutil can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc/linutil.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/proc/native uses github.com/go-delve/delve/pkg/proc/core, so a change to github.com/go-delve/delve/pkg/proc/core can break github.com/go-delve/delve/pkg/proc/native, while a change to github.com/go-delve/delve/pkg/proc/native can't break github.com/go-delve/delve/pkg/proc/core.
Position
Below the diagonal: github.com/go-delve/delve/pkg/proc/native uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/service, while a change to github.com/go-delve/delve/service can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/service uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service uses github.com/go-delve/delve/service/debugger, so a change to github.com/go-delve/delve/service/debugger can break github.com/go-delve/delve/service, while a change to github.com/go-delve/delve/service can't break github.com/go-delve/delve/service/debugger.
Position
Below the diagonal: github.com/go-delve/delve/service uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal/starbind uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/pkg/terminal/starbind, while a change to github.com/go-delve/delve/pkg/terminal/starbind can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal/starbind uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal/starbind uses github.com/go-delve/delve/service, so a change to github.com/go-delve/delve/service can break github.com/go-delve/delve/pkg/terminal/starbind, while a change to github.com/go-delve/delve/pkg/terminal/starbind can't break github.com/go-delve/delve/service.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal/starbind uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/dap uses github.com/go-delve/delve/pkg/logflags, so a change to github.com/go-delve/delve/pkg/logflags can break github.com/go-delve/delve/service/dap, while a change to github.com/go-delve/delve/service/dap can't break github.com/go-delve/delve/pkg/logflags.
Position
Below the diagonal: github.com/go-delve/delve/service/dap uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/dap uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/service/dap, while a change to github.com/go-delve/delve/service/dap can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/service/dap uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/dap uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/service/dap, while a change to github.com/go-delve/delve/service/dap can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/service/dap uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/dap uses github.com/go-delve/delve/service/debugger, so a change to github.com/go-delve/delve/service/debugger can break github.com/go-delve/delve/service/dap, while a change to github.com/go-delve/delve/service/dap can't break github.com/go-delve/delve/service/debugger.
Position
Below the diagonal: github.com/go-delve/delve/service/dap uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/dap uses github.com/go-delve/delve/service, so a change to github.com/go-delve/delve/service can break github.com/go-delve/delve/service/dap, while a change to github.com/go-delve/delve/service/dap can't break github.com/go-delve/delve/service.
Position
Below the diagonal: github.com/go-delve/delve/service/dap uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpc2 uses github.com/go-delve/delve/pkg/proc, so a change to github.com/go-delve/delve/pkg/proc can break github.com/go-delve/delve/service/rpc2, while a change to github.com/go-delve/delve/service/rpc2 can't break github.com/go-delve/delve/pkg/proc.
Position
Below the diagonal: github.com/go-delve/delve/service/rpc2 uses a module listed above it, which is the healthy direction.
82 pairs of types, where a type in github.com/go-delve/delve/service/rpc2 uses a type in github.com/go-delve/delve/service/api. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/go-delve/delve/service/rpc2 uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/service/rpc2, while a change to github.com/go-delve/delve/service/rpc2 can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/service/rpc2 uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpc2 uses github.com/go-delve/delve/service/debugger, so a change to github.com/go-delve/delve/service/debugger can break github.com/go-delve/delve/service/rpc2, while a change to github.com/go-delve/delve/service/rpc2 can't break github.com/go-delve/delve/service/debugger.
Position
Below the diagonal: github.com/go-delve/delve/service/rpc2 uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpc2 uses github.com/go-delve/delve/service, so a change to github.com/go-delve/delve/service can break github.com/go-delve/delve/service/rpc2, while a change to github.com/go-delve/delve/service/rpc2 can't break github.com/go-delve/delve/service.
Position
Below the diagonal: github.com/go-delve/delve/service/rpc2 uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/pkg/goversion, so a change to github.com/go-delve/delve/pkg/goversion can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/pkg/goversion.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/pkg/terminal/colorize, so a change to github.com/go-delve/delve/pkg/terminal/colorize can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/pkg/terminal/colorize.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in github.com/go-delve/delve/pkg/terminal uses a type in github.com/go-delve/delve/service/api. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/pkg/config, so a change to github.com/go-delve/delve/pkg/config can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/pkg/config.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/service, so a change to github.com/go-delve/delve/service can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/service.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/pkg/terminal uses github.com/go-delve/delve/pkg/terminal/starbind, so a change to github.com/go-delve/delve/pkg/terminal/starbind can break github.com/go-delve/delve/pkg/terminal, while a change to github.com/go-delve/delve/pkg/terminal can't break github.com/go-delve/delve/pkg/terminal/starbind.
Position
Below the diagonal: github.com/go-delve/delve/pkg/terminal uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpccommon uses github.com/go-delve/delve/pkg/logflags, so a change to github.com/go-delve/delve/pkg/logflags can break github.com/go-delve/delve/service/rpccommon, while a change to github.com/go-delve/delve/service/rpccommon can't break github.com/go-delve/delve/pkg/logflags.
Position
Below the diagonal: github.com/go-delve/delve/service/rpccommon uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpccommon uses github.com/go-delve/delve/service/api, so a change to github.com/go-delve/delve/service/api can break github.com/go-delve/delve/service/rpccommon, while a change to github.com/go-delve/delve/service/rpccommon can't break github.com/go-delve/delve/service/api.
Position
Below the diagonal: github.com/go-delve/delve/service/rpccommon uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpccommon uses github.com/go-delve/delve/service/debugger, so a change to github.com/go-delve/delve/service/debugger can break github.com/go-delve/delve/service/rpccommon, while a change to github.com/go-delve/delve/service/rpccommon can't break github.com/go-delve/delve/service/debugger.
Position
Below the diagonal: github.com/go-delve/delve/service/rpccommon uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpccommon uses github.com/go-delve/delve/service, so a change to github.com/go-delve/delve/service can break github.com/go-delve/delve/service/rpccommon, while a change to github.com/go-delve/delve/service/rpccommon can't break github.com/go-delve/delve/service.
Position
Below the diagonal: github.com/go-delve/delve/service/rpccommon uses a module listed above it, which is the healthy direction.
github.com/go-delve/delve/service/rpccommon uses github.com/go-delve/delve/service/rpc2, so a change to github.com/go-delve/delve/service/rpc2 can break github.com/go-delve/delve/service/rpccommon, while a change to github.com/go-delve/delve/service/rpccommon can't break github.com/go-delve/delve/service/rpc2.
Position
Below the diagonal: github.com/go-delve/delve/service/rpccommon uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 64% · Adequate · gated by D1, D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
132
Medium
A03:2025 — Software Supply Chain Failures
6
Medium
Roadmap
Begin by addressing the 64 swallowed exceptions to improve stability, then establish a structured process for recording significant design decisions in the docs/adr folder. Ensure new contributors can quickly get started by adding a build and run section to the root README. Finally, refactor functions making requests to properly thread context.Context, ensuring work stops promptly when callers cancel.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 1
A definite problem that already costs you something and drags the score down: a
missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here
tends to cause failures elsewhere.
Serious — 717
Likely wrong, but not failing yet. It degrades
the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to
carry for two years either.
Minor — 188
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 21
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 52 of 55 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 55 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 886 of 906 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.go) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.go), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (REDACTED), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via Dockerfile (vendor/github.com/creack/pty/Dockerfile.riscv). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; runtime evidence skipped.
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Go, Python, c is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Go, Python, c is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 24 further occurrence(s) are not listed individually; the score already reflects all 64.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's C, Python is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 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.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
153 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was godwarf.readType at 94. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being RISCV64Registers.GetReg at 33 — they are counted neither in the figure above nor in this dimension's score.
+ 147 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with godwarf.readType (cyclomatic 94), evalStack.executeOp (cyclomatic 65), EvalScope.evalTypeCast (cyclomatic 61). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cyclomatic Complexity from 3.2 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
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.
+ 222 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 25 bodies over 60 down to 60 or less in Cognitive Complexity — start with godwarf.readType (cognitive 164), native.trapWaitInternal (cognitive 147), cmds.traceCmd (cognitive 122). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 25 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
Do you agree with this assessment?
D3 · God Classes8.1 / 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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 FileTooLong finding(s) in God Classes — start with server.go (2), command.go, eval.go. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 14 TooManyMethods finding(s) in God Classes — start with client.go (2), server.go (2), debugger.go. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 12 ClassTooLong finding(s) in God Classes — start with server.go (2), debugger.go, bininfo.go. — One of this dimension's main actionable groups (12 warning-level).
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.
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.
67 duplicated block group(s) detected. A further 6 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3pkg/proc/amd64_arch.go:136
+ 37 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with arm64_arch.go, dump.go, eval.go. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with eval.go (3), evalcompile.go, REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 5 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), amd64_arch.go, dump.go. — One of this dimension's main actionable groups (5 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with reader.go, eval.go, target.go. — One of this dimension's main actionable groups (4 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
657 test methods: 657 unit, 0 integration, 0 BDD, 0 e2e. The Go suite contributes 657 test case(s) across 52 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 17 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
8 outdated, 0 author-deprecated direct Go module(s), 0 pinning or checksum defect(s). 16 of 16 direct requirement(s) were graded against proxy.golang.org (0 not served there, 2 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.
Outdated: github.com/creack/pty · ×8
What to do
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 3 Hotspot finding(s) in Churn × Complexity Hotspots — start with bininfo.go, mapiter.go, eval.go. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.1 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pkg/proc/arm64_arch.go. Counted over 132 of the 234 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
133 deducted task-comment markers across 75937 LoC (0.2/KLoC) → score 9.7. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
TodoComment · ×130cmd/dlv/dlv_test.go:944
HackComment · ×3pkg/proc/eval.go:2261
What to do
Resolve the 130 TodoComment finding(s) in Explicit Debt — start with server.go (39), server_test.go (18), REDACTED (5). — One of this dimension's main actionable groups (130 warning-level).
Resolve the 3 HackComment finding(s) in Explicit Debt — start with eval.go, command.go, server_test.go. — One of this dimension's main actionable groups (3 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README and the Documentation/README are both excellent at conveying what Delve is (a Go debugger) and where to find documentation. The Documentation/installation/README gives installation instructions for Go >=1.16, binary releases, cosign verification, and a complete install path; it also links out to the Usage docs. The Documentation/cli/README covers commands like call, continue, restart, rev, rewind, step-instruction, and the API interfaces (JSON-RPC/DAP), with usage examples. The Documentation/api directories are well-structured for their audience, covering both APIs and the DAP protocol in detail. All visible documentation is present and clear; no gaps or defects.
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
1 of 1 build units (Go) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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).
154 finding(s): 0 critical, 0 high, 5 medium, 149 low. semgrep hit a parse error in 1 file(s) — `_fixtures/rangeoverfunc.go` (line 285, line 297, line 311) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
15 of 132 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pkg/proc/linutil/regs_riscv64_arch.go. Counted over 132 of the 234 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 15 Orphaned file finding(s) in Knowledge Freshness — start with regs_riscv64_arch.go, REDACTED, command.go. — One of this dimension's main actionable groups (15 recommendation-level).
Resolve the 1 Orphaned files with no living knowledge finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 2 Change coupling finding(s) in Change Coupling — start with client.go, arm64_arch.go. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED 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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
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 build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
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 numbered `NNNN-title` documents in any markup this check reads, 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
README claims AI usage policy is a separate document but no such file exists — searched for: `Documentation/AI/AI_POLICY.md`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong. — README.md:1
Documentation/api/ClientHowto.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Documentation/api/ClientHowto.md:42
Documentation/internal/portnotes.md names `cmd/link`, but no file or folder `cmd/link` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Documentation/internal/portnotes.md:41
Documentation/api/json-rpc/README.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — Documentation/api/json-rpc/README.md:13
What to do
Reconcile the README with reality: README claims AI usage policy is a separate document but no such file exists; Documentation/api/ClientHowto.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists; Documentation/internal/portnotes.md names `cmd/link`, but no file or folder `cmd/link` exists; Documentation/api/json-rpc/README.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Your ecosystem's static analyzer is declared as a dependency but is not wired into CI — run it as a required step on push/PR (e.g. `composer phpstan` / `mix sobelow` / `bundle exec brakeman` / the spotbugs Gradle task / `sbt scalafixAll --check` / `golangci-lint run` / `rebar3 lint`) so a regression fails the build instead of relying on someone running it locally.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 123 use(s) across 80,396 production line(s) (~1.5/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`dlen` is read from the bytes being parsed at line 111 (`binary.BigEndian.Uint64`), then used to size a `make([]byte, …)` at line 112 — and nowhere in its scope is `dlen` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: `make` reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the runtime cannot satisfy is `fatal error: out of memory` — not a panic, so no `recover` intercepts it and the whole process dies; a 64-bit length too large to represent panics with `makeslice: len out of range` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `dlen` against the bytes actually remaining and a maximum the format allows before allocating. — pkg/dwarf/godwarf/sections.go:112
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/2 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`netDial` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — cmd/dlv/cmds/commands.go:1269
`Dial` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`. — REDACTED:309
What to do
Thread a context.Context through functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
`main` starts a goroutine on every pass of a loop, and each one writes `failedPlatforms`, a slice declared before the loop — `failedPlatforms = append(failedPlatforms, …)` on line 67. The loop never waits on `wg` before its next pass, so the goroutines of successive passes run at the same time and each one's write races the next one's; waiting on `wg` after the loop orders only what follows the wait. `failedPlatforms = append(failedPlatforms, …)` rewrites the slice variable itself — its pointer, length and capacity — so the other side reads or rewrites a variable mid-update: an append is lost, or a read sees a length its backing array does not have. `wg` is a `sync.WaitGroup`, which orders the handoff's signal and takes no exclusion over the slice's own state. Guard every write to `failedPlatforms` with one `sync.Mutex`, or have each goroutine send its result on a channel that this body alone receives from and writes into `failedPlatforms`. — _scripts/gen-capslock-all.go:67
What to do
In Go, hand values from a goroutine to the body waiting on it over a channel the body receives from, rather than through a map or slice beside a `sync.WaitGroup` or a signal channel — or hold one `sync.Mutex` over every access to the shared map or slice on both sides. The wait orders the signal; it takes no exclusion over the map's or slice's own state.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×34) — _scripts/rtype.go:746, _scripts/make.go:273, _scripts/make.go:277, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×2) — pkg/internal/gosym/pclntab.go:280, pkg/internal/gosym/pclntab.go:660
`if fileErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/proc/stack.go:524
`if _, err := p.Memory().ReadMemory(target, addr); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — pkg/proc/arm64_disasm.go:174
`if err := os.Remove(filepath.Join(dir, fi.Name())); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:336
`if _, err := exec.LookPath(" "); err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:112
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
D11 Test Reliability — 1 observation(s) recorded · This repository declares 1 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.go), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
X10 Duplicated predicate — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 57 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 — Not applicable: this repository's Go imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads.
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~31008 lines of test source are present (.go) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D14 License Compliance — Not scored — this repository's 1 declared JVM dependency coordinate(s) were read from its 1 Maven/Gradle manifest(s), but Maven Central could not be asked for the licence of 0 of them (no diagnostic), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Aggregate roots were found in only one source directory (proc), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.go), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D5 Coupling — Not applicable — this Go build ships 1 production module(s), so there is no coupling BETWEEN modules to measure. (Its test and non-production modules are not part of the shipped graph.)
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
DM1 Domain Modelling — applicable but not scored (2 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 1 value object(s)
ED1 Event-Driven — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 1 CQRS handler(s); 1 event-sourced shape(s) (event folds / event-recording aggregates)
ED5 Idempotency — Not assessed, and this one is on us: 1 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 Go aggregate(s) recording domain events (own events-slice append / raise-record))
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Go, Python source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF3 Async & latency hygiene — Not applicable: Go has no async/await function colour, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X16 Unfloored truncation loop — 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
X18 Disposal-pattern 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
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X29 Per-element action decided by a fixed element — 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
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — 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
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 1 finding(s)
D11 · Test Reliability· Test declared unreliable · ×1
Test declared unreliable: TestBreakPointFailWithCond pkg/terminal/command_test.go:1813— This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
TodoComment cmd/dlv/dlv_test.go:944— // TODO(derekparker) this test has to be a bit vague to avoid flakiness. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cmd/dlv/dlv_test.go:1237— // TODO: Perhaps we shouldn't be setting these default breakpoints in trace mode, however. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment cmd/dlv/cmds/commands.go:251— // TODO(polina): support --tty when dlv dap allows to launch a program from command-line — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/dwarf/frame/parser.go:75— //TODO(aarzilli): this does not support 64bit DWARF — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/dwarf/godwarf/type.go:684— // TODO(rsc): Can also be TagEnumerationType — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/dwarf/godwarf/type.go:830— // TODO: Should have original compilation — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/elfwriter/delve_core_notes.go:11— //TODO(aarzilli): these constants probably need to be in a better place. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/locspec/locations.go:282— //TODO(aarzilli): this needs only the list of function we should make it work — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/variables_test.go:1630— // TODO(deparker): we *should* get an error here, but the one we expect in this test — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/target_exec.go:1078— // TODO(derekparker) it should be possible to still use some internal — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/target_exec.go:1199— //TODO(aarzilli): if we want to let users hide functions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/riscv64_arch.go:45— // TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/proc_test.go:2968— // TODO(derekparker): Add support for PE. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/proc_test.go:3014— // TODO(derekparker): Add support for PE. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/proc_test.go:3750— // TODO(qmuntal): seems to be an upstream issue, investigate. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/ppc64le_arch.go:222— // TODO: is this save slot correct? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/mapiter.go:317— // TODO: this needs to be > hashTophashEmptyOne for go >= 1.12 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/mapiter.go:746— // TODO: check that this hasn't changed after it's merged and the TODO is deleted — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/i386_disasm.go:1— // TODO: disassembler support should be compiled in unconditionally, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/amd64_disasm.go:1— // TODO: disassembler support should be compiled in unconditionally, — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/i386_disasm.go:32— // TODO(chainhelen), need to support other OSs. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/i386_arch.go:96— // TODO(chainhelen), need to check whether there is a bad frame descriptor like amd64. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/i386_arch.go:131— // TODO(chainhelen), need to support cgo stacktraces. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/fncall.go:464— // TODO: use target architecture endianness instead of LittleEndian — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment pkg/proc/fncall.go:573— //TODO(aarzilli): only apply the escapeCheck to leaking parameters. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Swallowed exception (caught, then discarded) _scripts/rtype.go:746— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) _scripts/make.go:273— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) _scripts/make.go:277— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) _scripts/make.go:287— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) _scripts/gen-capslock-all.go:134— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) cmd/dlv/cmds/commands.go:950— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) cmd/dlv/cmds/commands.go:958— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/dwarf/op/op.go:75— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/dwarf/op/op.go:113— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/x86_disasm.go:89— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/x86_disasm.go:106— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:535— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:626— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) REDACTED:1046— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/target_exec.go:1382— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/target.go:682— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/stack.go:381— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/stack.go:524— `if fileErr != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/riscv64_disasm.go:101— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/ppc64le_disasm.go:99— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/mapiter.go:314— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/loong64_disasm.go:104— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/fncall.go:1162— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/eval.go:263— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) pkg/proc/eval.go:781— `if err != nil` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
FileTooLong: dap/server.go service/dap/server.go— FileTooLong — 2832 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: Session (103 blocks, 177-4717). The bar is 500 significant lines; this is 2332 over it, 5.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: terminal/command.go pkg/terminal/command.go— FileTooLong — 2169 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1669 over it, 4.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proc/eval.go pkg/proc/eval.go— FileTooLong — 2159 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1659 over it, 4.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proc/bininfo.go pkg/proc/bininfo.go— FileTooLong — 1994 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1494 over it, 3.99× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: debugger/debugger.go service/debugger/debugger.go— FileTooLong — 1741 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: Debugger (98 blocks, 64-2871). The bar is 500 significant lines; this is 1241 over it, 3.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1028 over it, 3.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1277 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 777 over it, 2.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gdbserial/gdbserver_conn.go pkg/proc/gdbserial/gdbserver_conn.go— FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: gdbConn (45 blocks, 23-1470). The bar is 500 significant lines; this is 496 over it, 1.99× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cmds/commands.go cmd/dlv/cmds/commands.go— FileTooLong — 840 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 340 over it, 1.68× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proc/fncall.go pkg/proc/fncall.go— FileTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 312 over it, 1.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proc/stack.go pkg/proc/stack.go— FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 283 over it, 1.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: proc/breakpoints.go pkg/proc/breakpoints.go— FileTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 269 over it, 1.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 767 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 267 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: rpc2/server.go service/rpc2/server.go— FileTooLong — 688 significant lines (blank, comment-only and punctuation-only lines excluded), about 61% of them inside a single declaration: RPCServer (59 blocks, 17-1290). The bar is 500 significant lines; this is 188 over it, 1.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: godwarf/type.go pkg/dwarf/godwarf/type.go— FileTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 179 over it, 1.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: native/proc_linux.go pkg/proc/native/proc_linux.go— FileTooLong — 626 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 126 over it, 1.25× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: evalop/evalcompile.go pkg/proc/evalop/evalcompile.go— FileTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: compileCtx (20 blocks, 31-885). The bar is 500 significant lines; this is 105 over it, 1.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: terminal/terminal.go pkg/terminal/terminal.go— FileTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: Term (28 blocks, 58-832). The bar is 500 significant lines; this is 47 over it, 1.09× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 533 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 33 over it, 1.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
TooManyMethods: Client service/dap/daptest/client.go:24— TooManyMethods — 198 methods, declared across 2 files: daptest/resp.go (122), daptest/client.go (76). The bar is 30 methods; this is 168 over it, 6.60× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Session service/dap/server.go:177— TooManyMethods — 109 methods, declared across 2 files: dap/server.go (102), dap/command.go (7). The bar is 30 methods; this is 79 over it, 3.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Debugger service/debugger/debugger.go:64— TooManyMethods — 97 methods. The bar is 30 methods; this is 67 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RPCClient service/rpc2/client.go:21— TooManyMethods — 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. Most of these members implement service.Client (83 of 90 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: BinaryInfo pkg/proc/bininfo.go:56— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RPCServer service/rpc2/server.go:17— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: gdbProcess REDACTED:144— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Variable REDACTED:103— TooManyMethods — 45 methods, declared across 3 files: REDACTED (34), proc/eval.go (10), proc/mapiter.go (1). The bar is 30 methods; this is 15 over it, 1.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: gdbConn pkg/proc/gdbserial/gdbserver_conn.go:23— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Target pkg/proc/target.go:39— TooManyMethods — 39 methods, declared across 5 files: proc/target.go (22), proc/breakpoints.go (9), proc/dump.go (4), proc/stackwatch.go (2), +1 more file(s). The bar is 30 methods; this is 9 over it, 1.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: process pkg/proc/core/core.go:158— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Term pkg/terminal/terminal.go:58— TooManyMethods — 34 methods, declared across 2 files: terminal/terminal.go (27), terminal/command.go (7). The bar is 30 methods; this is 4 over it, 1.13× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: nativeProcess pkg/proc/native/proc.go:15— TooManyMethods — 32 methods, declared across 6 files: native/proc.go (16), native/proc_linux.go (10), REDACTED (3), native/dump_linux.go (1), +2 more file(s). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TargetGroup pkg/proc/target_group.go:20— TooManyMethods — 31 methods, declared across 3 files: proc/target_group.go (19), proc/target_exec.go (8), proc/target.go (4). The bar is 30 methods; this is 1 over it, 1.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Session service/dap/server.go:177— ClassTooLong — 2372 significant lines (blank, comment-only and punctuation-only lines excluded), 109 methods, 103 blocks, lines 177-4717. The bar is 400 significant lines; this is 1972 over it, 5.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Debugger service/debugger/debugger.go:64— ClassTooLong — 1421 significant lines (blank, comment-only and punctuation-only lines excluded), 97 methods, 98 blocks, lines 64-2871. The bar is 400 significant lines; this is 1021 over it, 3.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BinaryInfo pkg/proc/bininfo.go:56— ClassTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods, 64 blocks, lines 56-3391. The bar is 400 significant lines; this is 637 over it, 2.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EvalScope pkg/proc/eval.go:40— ClassTooLong — 900 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods, 26 blocks, lines 40-2614. The bar is 400 significant lines; this is 500 over it, 2.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: gdbConn pkg/proc/gdbserial/gdbserver_conn.go:23— ClassTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods, 45 blocks, lines 23-1470. The bar is 400 significant lines; this is 399 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Variable REDACTED:103— ClassTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods, 34 blocks, lines 103-2458. The bar is 400 significant lines; this is 306 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: gdbProcess REDACTED:144— ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods, 47 blocks, lines 144-1664. The bar is 400 significant lines; this is 101 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: compileCtx pkg/proc/evalop/evalcompile.go:31— ClassTooLong — 498 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, 20 blocks, lines 31-885. The bar is 400 significant lines; this is 98 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Commands pkg/terminal/command.go:86— ClassTooLong — 461 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods, 29 blocks, lines 86-3407. The bar is 400 significant lines; this is 61 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Term pkg/terminal/terminal.go:58— ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods, 28 blocks, lines 58-832. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RPCServer service/rpc2/server.go:17— ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, 59 blocks, lines 17-1290. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: stackIterator pkg/proc/stack.go:224— ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods, 16 blocks, lines 224-886. The bar is 400 significant lines; this is 4 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: Session.onLaunchRequest service/dap/server.go:1053— MethodTooLong — onLaunchRequest runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EvalScope.evalTypeCast pkg/proc/eval.go:1530— MethodTooLong — evalTypeCast runs 216 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: evalStack.executeOp pkg/proc/eval.go:1111— MethodTooLong — executeOp runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Session.handleRequest service/dap/server.go:710— MethodTooLong — handleRequest runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Debugger.Command service/debugger/debugger.go:1099— MethodTooLong — Command runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: compileCtx.compileAST pkg/proc/evalop/evalcompile.go:293— MethodTooLong — compileAST runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: processGroup.waitForDebugEvent REDACTED:345— MethodTooLong — waitForDebugEvent runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Variable.loadValueInternal REDACTED:1362— MethodTooLong — loadValueInternal runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Session.childrenToDAPVariables service/dap/server.go:2855— MethodTooLong — childrenToDAPVariables runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EvalScope.evalCallInjectionStart pkg/proc/fncall.go:246— MethodTooLong — evalCallInjectionStart runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Variable.findStructMemberOrMethod pkg/proc/eval.go:3027— MethodTooLong — findStructMemberOrMethod runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: godwarf.readType pkg/dwarf/godwarf/type.go:564— FunctionTooLong — readType runs 339 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 239 over it, 3.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cmds.New cmd/dlv/cmds/commands.go:121— FunctionTooLong — New runs 227 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cmds.traceCmd cmd/dlv/cmds/commands.go:672— FunctionTooLong — traceCmd runs 179 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proc.sigtrampContextDarwinAMD64 REDACTED:724— FunctionTooLong — sigtrampContextDarwinAMD64 runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: native.trapWaitInternal pkg/proc/native/proc_linux.go:440— FunctionTooLong — trapWaitInternal runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proc.arm64SwitchStack pkg/proc/arm64_arch.go:147— FunctionTooLong — arm64SwitchStack runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: terminal.setBreakpoint pkg/terminal/command.go:1889— FunctionTooLong — setBreakpoint runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cmds.execute cmd/dlv/cmds/commands.go:1067— FunctionTooLong — execute runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proc.rangeFuncStackTrace pkg/proc/stack.go:1161— FunctionTooLong — rangeFuncStackTrace runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proc.funcCallStep pkg/proc/fncall.go:811— FunctionTooLong — funcCallStep runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (15 lines × 2) pkg/proc/arm64_arch.go:225— pkg/proc/arm64_arch.go:225-241 | pkg/proc/ppc64le_arch.go:117-131 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/ppc64le_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/arm64_arch.go:225` 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 (15 lines × 2) pkg/proc/dump.go:403— pkg/proc/dump.go:403-417 | service/rpccommon/server.go:396-410 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `service/rpccommon/server.go:396` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `service/rpccommon/server.go:395` calls `Inc` and `pkg/proc/dump.go:402` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) pkg/proc/eval.go:1641— pkg/proc/eval.go:1641-1655 | pkg/proc/eval.go:1657-1671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) pkg/proc/fbsdutil/regs.go:165— pkg/proc/fbsdutil/regs.go:165-179 | pkg/proc/linutil/regs_amd64_arch.go:139-153 — before extracting anything, compare `pkg/proc/fbsdutil/regs.go` and `pkg/proc/linutil/regs_amd64_arch.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/fbsdutil/regs.go:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) pkg/proc/bininfo.go:2467— pkg/proc/bininfo.go:2467-2481 | pkg/proc/bininfo.go:2523-2537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/bininfo.go:2467` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) pkg/proc/eval.go:1924— pkg/proc/eval.go:1924-1932 | pkg/proc/eval.go:1957-1965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:1924` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) pkg/proc/evalop/evalcompile.go:746— pkg/proc/evalop/evalcompile.go:746-754 | pkg/proc/evalop/evalcompile.go:776-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/evalop/evalcompile.go:746` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) REDACTED:356— REDACTED:356-364 | REDACTED:436-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:356` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) pkg/proc/eval.go:1911— pkg/proc/eval.go:1911-1919 | pkg/proc/eval.go:1943-1951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:1911` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) pkg/proc/eval.go:2736— pkg/proc/eval.go:2736-2744 | pkg/proc/eval.go:2754-2762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:2736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) pkg/proc/amd64_arch.go:357— pkg/proc/amd64_arch.go:357-363 | pkg/proc/i386_arch.go:241-247 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/i386_arch.go` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/amd64_arch.go:357` 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 (7 lines × 2) pkg/proc/dump.go:420— pkg/proc/dump.go:420-426 | service/rpccommon/server.go:413-419 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) REDACTED:816— REDACTED:816-822 | pkg/proc/native/proc.go:151-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) REDACTED:2187— REDACTED:2187-2193 | REDACTED:2196-2202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2187` 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 (7 lines × 2) service/dap/server.go:1165— service/dap/server.go:1165-1171 | service/dap/server.go:1177-1183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) pkg/proc/amd64_arch.go:352— pkg/proc/amd64_arch.go:352-356 | pkg/proc/i386_arch.go:236-240 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/i386_arch.go` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/amd64_arch.go:352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pkg/proc/i386_arch.go:234` calls `Sprintf` and `pkg/proc/amd64_arch.go:350` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) service/api/conversions.go:201— service/api/conversions.go:201-205 | service/api/conversions.go:222-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/api/conversions.go:201` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) REDACTED:267— REDACTED:267-271 | REDACTED:140-144 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) REDACTED:941— REDACTED:941-945 | REDACTED:946-950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:941` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) pkg/proc/eval.go:1695— pkg/proc/eval.go:1695-1699 | pkg/proc/eval.go:1717-1721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:1695` 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.
TooManyFields: AMD64CONTEXT REDACTED:209— TooManyFields — 46 stored fields beside 4 methods. The bar is 30 stored fields; this is 16 over it, 1.53× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: _RTL_USER_PROCESS_PARAMETERS REDACTED:757— TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RISCV64PtraceRegs pkg/proc/linutil/regs_riscv64_arch.go:35— TooManyFields — 32 stored fields. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Arch pkg/proc/arch.go:12— TooManyFields — 31 stored fields beside 9 methods. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Low cohesion: Reader (LCOM4 7) pkg/dwarf/reader/reader.go:12— Reader's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: EvalScope (LCOM4 7) pkg/proc/eval.go:40— EvalScope's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Target (LCOM4 6) pkg/proc/target.go:39— Target's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Image (LCOM4 4) pkg/proc/bininfo.go:1089— Image's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Hotspot: pkg/proc/bininfo.go pkg/proc/bininfo.go:1767— pkg/proc/bininfo.go changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in proc.loadBinaryInfoElf at line 1767. 1 of those changes was a fix/bug commit, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 13:37:38 +02:00' --until='2026-10-20 13:37:38 +02:00' --full-history --no-merges -- pkg/proc/bininfo.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pkg/proc/mapiter.go pkg/proc/mapiter.go:521— pkg/proc/mapiter.go changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in mapIteratorSwiss.next at line 521. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 13:37:38 +02:00' --until='2026-10-20 13:37:38 +02:00' --full-history --no-merges -- pkg/proc/mapiter.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: pkg/proc/eval.go pkg/proc/eval.go:2174— pkg/proc/eval.go changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in EvalScope.evalIndex at line 2174. 1 of those changes was a fix/bug commit, and the other 2 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-22..2026-10-20, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-22 13:37:38 +02:00' --until='2026-10-20 13:37:38 +02:00' --full-history --no-merges -- pkg/proc/eval.go`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
HackComment pkg/proc/eval.go:2261— // HACK: slicing a map expression with [0:0] will return the whole map — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment pkg/terminal/command.go:2295— // HACK: in go '=' is not an operator, we detect the error and try to recover from it by splitting the input string — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment service/dap/server_test.go:7673— // hack to test the inner connection logic that is used by a server that does. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) pkg/proc/amd64_arch.go:136— pkg/proc/amd64_arch.go:136-260 | pkg/proc/arm64_arch.go:147-356 | pkg/proc/i386_arch.go:119-186 | pkg/proc/loong64_arch.go:119-251 | pkg/proc/riscv64_arch.go:138-280 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) pkg/proc/linutil/regs_amd64_arch.go:59— pkg/proc/linutil/regs_amd64_arch.go:59-105 | pkg/proc/linutil/regs_arm64_arch.go:37-90 | pkg/proc/linutil/regs_loong64_arch.go:42-99 | pkg/proc/linutil/regs_ppc64le_arch.go:79-142 | pkg/proc/linutil/regs_riscv64_arch.go:71-126 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:116— REDACTED:116-213 | REDACTED:215-284 | REDACTED:286-327 | REDACTED:329-372 | REDACTED:374-480 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (16 lines × 2) REDACTED:83— REDACTED:83-98 | pkg/proc/native/proc.go:450-465 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:83` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) pkg/proc/loong64_arch.go:154— pkg/proc/loong64_arch.go:154-169 | pkg/proc/riscv64_arch.go:177-192 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) pkg/proc/arm64_disasm.go:203— pkg/proc/arm64_disasm.go:203-218 | pkg/proc/riscv64_disasm.go:121-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) pkg/proc/eval.go:1591— pkg/proc/eval.go:1591-1598 | pkg/proc/eval.go:1618-1625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:1591` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) pkg/proc/stack.go:681— pkg/proc/stack.go:681-688 | pkg/proc/stack.go:734-741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) REDACTED:538— REDACTED:538-545 | REDACTED:824-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:538` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) service/api/prettyprint.go:386— service/api/prettyprint.go:386-391 | service/api/prettyprint.go:486-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/api/prettyprint.go:386` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) pkg/terminal/command.go:2751— pkg/terminal/command.go:2751-2756 | service/api/prettyprint.go:587-592 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) pkg/proc/gdbserial/gdbserver_conn.go:492— pkg/proc/gdbserial/gdbserver_conn.go:492-497 | pkg/proc/gdbserial/gdbserver_conn.go:1036-1041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/gdbserial/gdbserver_conn.go:492` 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 first that the copies are not typed on the same thing: the declarations holding them bind `string` to `annex` in one and `conn *gdbConn) appendThreadSelector(threadID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
AMD64Registers.SetReg (cyclomatic 27) pkg/proc/fbsdutil/regs.go:186— AMD64Registers.SetReg has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AMD64Registers.SetReg (cyclomatic 27) pkg/proc/linutil/regs_amd64_arch.go:160— AMD64Registers.SetReg has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Change coupling: client.go ↔ error_ids.go service/dap/daptest/client.go:1— `service/dap/daptest/client.go` and `service/dap/error_ids.go` change together 79% of the time (19 of the 24 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `c0809b87` service/dap: add dap write memory request handler (#4364); `2a508e53` service/dap: support data breakpoints (#4294); `9103a459` service/dap: add dap read memory request handler (#4083) — run `git show` on any of them.
Change coupling: arm64_arch.go ↔ i386_arch.go pkg/proc/arm64_arch.go:1— `pkg/proc/arm64_arch.go` and `pkg/proc/i386_arch.go` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `50a45f1b` proc: propogate errors from switchToGoroutineStack; `281f3920` proc: fix stacktraces on freebsd/amd64/go1.20 (#3458); `3507ff97` proc: support multiple functions with the same name (#3297) — run `git show` on any of them.
Duplicated block (18 lines × 2) REDACTED:1874— REDACTED:1874-1891 | REDACTED:1927-1944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1874` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) pkg/proc/gdbserial/gdbserver_conn.go:1481— pkg/proc/gdbserial/gdbserver_conn.go:1481-1498 | pkg/proc/gdbserial/gdbserver_conn.go:1528-1545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/gdbserial/gdbserver_conn.go:1481` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) pkg/proc/breakpoints.go:949— pkg/proc/breakpoints.go:949-965 | pkg/proc/breakpoints.go:972-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/breakpoints.go:949` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) pkg/proc/loong64_arch.go:121— pkg/proc/loong64_arch.go:121-137 | pkg/proc/riscv64_arch.go:140-156 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/loong64_arch.go:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) pkg/dwarf/parseutil.go:30— pkg/dwarf/parseutil.go:30-42 | pkg/proc/linutil/dynamic.go:30-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dwarf/parseutil.go: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) REDACTED:828— REDACTED:828-840 | REDACTED:907-919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) pkg/dwarf/regnum/amd64.go:134— pkg/dwarf/regnum/amd64.go:134-144 | pkg/dwarf/regnum/i386.go:74-84 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dwarf/regnum/amd64.go:134` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) pkg/proc/arm64_disasm.go:64— pkg/proc/arm64_disasm.go:64-74 | pkg/proc/ppc64le_disasm.go:103-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/arm64_disasm.go:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) REDACTED:311— REDACTED:311-318 | REDACTED:357-364 | REDACTED:437-444 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:311` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 3) REDACTED:191— REDACTED:191-198 | REDACTED:672-679 | REDACTED:850-857 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) pkg/proc/amd64_arch.go:198— pkg/proc/amd64_arch.go:198-205 | pkg/proc/loong64_arch.go:196-202 | pkg/proc/riscv64_arch.go:219-225 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/loong64_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7 lines × 3) pkg/proc/arm64_arch.go:260— pkg/proc/arm64_arch.go:260-266 | pkg/proc/loong64_arch.go:215-222 | pkg/proc/riscv64_arch.go:238-245 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/loong64_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/arm64_arch.go:260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 5) pkg/proc/amd64_arch.go:51— pkg/proc/amd64_arch.go:51-75 | pkg/proc/arm64_arch.go:62-86 | pkg/proc/i386_arch.go:44-68 | pkg/proc/loong64_arch.go:49-59 | pkg/proc/ppc64le_arch.go:50-55 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/arm64_arch.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/amd64_arch.go:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 5) REDACTED:184— REDACTED:184-189 | REDACTED:261-266 | REDACTED:314-319 | REDACTED:360-365 | REDACTED:440-445 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
X2 · Cancellation propagation· Function without context.Context · ×2
Function without context.Context: netDial cmd/dlv/cmds/commands.go:1269— `netDial` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Function without context.Context: Dial REDACTED:309— `Dial` calls `net.Dial(…)` but takes no context.Context and reaches none its caller controls, so its caller cannot cancel the request once it has started. Take `ctx context.Context` as the first parameter and build the request with it: `http.NewRequestWithContext(ctx, …)`, `(&net.Dialer{}).DialContext(ctx, …)`.
Swallowed exception (empty catch) pkg/internal/gosym/pclntab.go:280— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) pkg/internal/gosym/pclntab.go:660— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
godwarf.readType (cyclomatic 94) pkg/dwarf/godwarf/type.go:564— godwarf.readType has cyclomatic complexity 94 (threshold 15). Of this number, 83 points are the body's own statements and 11 belong to 3 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
evalStack.executeOp (cyclomatic 65) pkg/proc/eval.go:1111— evalStack.executeOp has cyclomatic complexity 65 (threshold 15). Of this number, 64 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.evalTypeCast (cyclomatic 61) pkg/proc/eval.go:1530— EvalScope.evalTypeCast has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compileCtx.compileAST (cyclomatic 61) pkg/proc/evalop/evalcompile.go:293— compileCtx.compileAST has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.simpleLocals (cyclomatic 59) pkg/proc/eval.go:425— EvalScope.simpleLocals has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.handleRequest (cyclomatic 57) service/dap/server.go:710— Session.handleRequest has cyclomatic complexity 57 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
Debugger.Command (cyclomatic 56) service/debugger/debugger.go:1099— Debugger.Command has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
native.trapWaitInternal (cyclomatic 53) pkg/proc/native/proc_linux.go:440— native.trapWaitInternal has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onLaunchRequest (cyclomatic 53) service/dap/server.go:1053— Session.onLaunchRequest has cyclomatic complexity 53 (threshold 15). Of this number, 44 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.loadValueInternal (cyclomatic 46) REDACTED:1362— Variable.loadValueInternal has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.convertVariableWithOpts (cyclomatic 46) service/dap/server.go:3125— Session.convertVariableWithOpts has cyclomatic complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cmds.traceCmd (cyclomatic 45) cmd/dlv/cmds/commands.go:672— cmds.traceCmd has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to one function literal inside it that branches (line 673). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
Variable.findStructMemberOrMethod (cyclomatic 45) pkg/proc/eval.go:3027— Variable.findStructMemberOrMethod has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.arm64SwitchStack (cyclomatic 44) pkg/proc/arm64_arch.go:147— proc.arm64SwitchStack has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
processGroup.waitForDebugEvent (cyclomatic 42) REDACTED:345— processGroup.waitForDebugEvent has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.writeTo (cyclomatic 41) service/api/prettyprint.go:94— Variable.writeTo has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.rangeFuncStackTrace (cyclomatic 39) pkg/proc/stack.go:1161— proc.rangeFuncStackTrace has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 7 of the 39 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1224, 1197, 1189). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RISCV64Registers.SetReg (cyclomatic 38) pkg/proc/linutil/regs_riscv64_arch.go:266— RISCV64Registers.SetReg has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
goversion.Parse (cyclomatic 37) pkg/goversion/go_version.go:40— goversion.Parse has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.evalCallInjectionStart (cyclomatic 37) pkg/proc/fncall.go:246— EvalScope.evalCallInjectionStart has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.newVariable (cyclomatic 36) REDACTED:686— proc.newVariable has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BinaryInfo.loadDebugInfoMaps (cyclomatic 36) pkg/proc/bininfo.go:2760— BinaryInfo.loadDebugInfoMaps has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbConn.parseStopPacket (cyclomatic 36) pkg/proc/gdbserial/gdbserver_conn.go:759— gdbConn.parseStopPacket has cyclomatic complexity 36 (threshold 15). Of this number, 26 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mapIteratorSwiss.loadTypes (cyclomatic 36) pkg/proc/mapiter.go:406— mapIteratorSwiss.loadTypes has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.setBreakpoint (cyclomatic 36) pkg/terminal/command.go:1889— terminal.setBreakpoint has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Debugger.traverse (cyclomatic 36) service/debugger/debugger.go:1424— Debugger.traverse has cyclomatic complexity 36 (threshold 15). Of this number, 22 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.funcCallStep (cyclomatic 35) pkg/proc/fncall.go:811— proc.funcCallStep has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.breakpointConditionSatisfiable (cyclomatic 34) pkg/proc/breakpoints.go:1243— proc.breakpointConditionSatisfiable has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1301, 1269, 1260). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
gdbserial.LLDBLaunch (cyclomatic 34) REDACTED:462— gdbserial.LLDBLaunch has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
colorize.Print (cyclomatic 34) pkg/terminal/colorize/colorize.go:30— colorize.Print has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 97, 69, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
debugger.guessSubstitutePath (cyclomatic 34) service/debugger/debugger.go:2695— debugger.guessSubstitutePath has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.FindFileLocation (cyclomatic 33) pkg/proc/bininfo.go:177— proc.FindFileLocation has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.compareOp (cyclomatic 33) pkg/proc/eval.go:2618— proc.compareOp has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
api.shortenTypeEx (cyclomatic 33) service/api/shorten_type.go:16— api.shortenTypeEx has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.arm64LinkerTrampolineTarget (cyclomatic 32) pkg/proc/arm64_disasm.go:78— proc.arm64LinkerTrampolineTarget has cyclomatic complexity 32 (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.
BinaryInfo.loadDebugInfoMapsCompileUnit (cyclomatic 32) pkg/proc/bininfo.go:2943— BinaryInfo.loadDebugInfoMapsCompileUnit has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mapIteratorClassic.nextBucket (cyclomatic 32) pkg/proc/mapiter.go:135— mapIteratorClassic.nextBucket has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Term.Run (cyclomatic 32) pkg/terminal/terminal.go:325— Term.Run has cyclomatic complexity 32 (threshold 15). Of this number, 20 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.
cmds.execute (cyclomatic 31) cmd/dlv/cmds/commands.go:1067— cmds.execute has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.riscv64SwitchStack (cyclomatic 31) pkg/proc/riscv64_arch.go:138— proc.riscv64SwitchStack has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.amd64SwitchStack (cyclomatic 30) pkg/proc/amd64_arch.go:136— proc.amd64SwitchStack has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mapIteratorSwiss.next (cyclomatic 30) pkg/proc/mapiter.go:521— mapIteratorSwiss.next has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.printTracepoint (cyclomatic 30) pkg/terminal/command.go:3004— terminal.printTracepoint has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.childrenToDAPVariables (cyclomatic 30) service/dap/server.go:2855— Session.childrenToDAPVariables has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.typeCastCompatibleTypes (cyclomatic 29) pkg/proc/eval.go:1813— proc.typeCastCompatibleTypes has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.loong64SwitchStack (cyclomatic 29) pkg/proc/loong64_arch.go:119— proc.loong64SwitchStack has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onThreadsRequest (cyclomatic 29) service/dap/server.go:2177— Session.onThreadsRequest has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Debugger.CreateBreakpoint (cyclomatic 29) service/debugger/debugger.go:695— Debugger.CreateBreakpoint has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.ppc64leSwitchStack (cyclomatic 28) pkg/proc/ppc64le_arch.go:105— proc.ppc64leSwitchStack has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BinaryInfo.openSeparateDebugInfo (cyclomatic 28) pkg/proc/bininfo.go:1633— BinaryInfo.openSeparateDebugInfo has cyclomatic complexity 28 (threshold 15). Of this number, 23 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.
minidump.Open (cyclomatic 28) REDACTED:320— minidump.Open has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.parseG (cyclomatic 28) REDACTED:905— Variable.parseG has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BreakpointState.checkCond (cyclomatic 27) pkg/proc/breakpoints.go:294— BreakpointState.checkCond has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
core.readNote (cyclomatic 27) pkg/proc/core/linux_core.go:299— core.readNote has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.evalBinary (cyclomatic 27) pkg/proc/eval.go:2506— EvalScope.evalBinary has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.Next (cyclomatic 27) pkg/proc/stack.go:266— stackIterator.Next has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Target.Dump (cyclomatic 27) pkg/proc/dump.go:96— Target.Dump has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.breakpoints (cyclomatic 27) pkg/terminal/command.go:1724— terminal.breakpoints has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
formReader.next (cyclomatic 26) pkg/dwarf/line/parse_util.go:85— formReader.next has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
starbind.unmarshalStarlarkValueIntl (cyclomatic 26) pkg/terminal/starbind/conv.go:623— starbind.unmarshalStarlarkValueIntl has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onExceptionInfoRequest (cyclomatic 26) service/dap/server.go:4114— Session.onExceptionInfoRequest has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.runUntilStopAndNotify (cyclomatic 26) service/dap/server.go:4417— Session.runUntilStopAndNotify has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.readSigtrampgoContext (cyclomatic 25) REDACTED:15— stackIterator.readSigtrampgoContext has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AMD64CONTEXT.SetReg (cyclomatic 25) REDACTED:290— AMD64CONTEXT.SetReg has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Env.interfaceToStarlarkValue (cyclomatic 25) pkg/terminal/starbind/conv.go:20— Env.interfaceToStarlarkValue has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BinaryInfo.macOSDebugFrameBugWorkaround (cyclomatic 24) pkg/proc/bininfo.go:2298— BinaryInfo.macOSDebugFrameBugWorkaround has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.Locals (cyclomatic 24) pkg/proc/eval.go:331— EvalScope.Locals has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbProcess.ContinueOnce (cyclomatic 24) REDACTED:848— gdbProcess.ContinueOnce has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbThread.reloadRegisters (cyclomatic 24) REDACTED:1693— gdbThread.reloadRegisters has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Target.SetWatchpoint (cyclomatic 24) pkg/proc/breakpoints.go:720— Target.SetWatchpoint has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Target.setBreakpointInternal (cyclomatic 24) pkg/proc/breakpoints.go:793— Target.setBreakpointInternal has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.i386SwitchStack (cyclomatic 23) pkg/proc/i386_arch.go:119— proc.i386SwitchStack has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbRegisters.Slice (cyclomatic 23) REDACTED:2148— gdbRegisters.Slice has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
native.stop1 (cyclomatic 23) pkg/proc/native/proc_linux.go:838— native.stop1 has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.isType (cyclomatic 23) pkg/proc/eval.go:2779— Variable.isType has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
starbind.New (cyclomatic 23) REDACTED:69— starbind.New has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 164, 85, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Env.variableValueToStarlarkValue (cyclomatic 23) pkg/terminal/starbind/conv.go:242— Env.variableValueToStarlarkValue has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
api.ParseGoroutineArgs (cyclomatic 23) service/api/command.go:35— api.ParseGoroutineArgs has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Debugger.collectBreakpointInformation (cyclomatic 23) service/debugger/debugger.go:1291— Debugger.collectBreakpointInformation has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbConn.recv (cyclomatic 22) pkg/proc/gdbserial/gdbserver_conn.go:1370— gdbConn.recv has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.structField (cyclomatic 22) REDACTED:1160— Variable.structField has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Term.handleExit (cyclomatic 22) pkg/terminal/terminal.go:555— Term.handleExit has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onAttachRequest (cyclomatic 22) service/dap/server.go:2322— Session.onAttachRequest has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
op.PrettyPrint (cyclomatic 21) pkg/dwarf/op/op.go:108— op.PrettyPrint has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.negotiateType (cyclomatic 21) pkg/proc/eval.go:2442— proc.negotiateType has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
core.threadsFromDelveNotes (cyclomatic 21) pkg/proc/core/delve_core.go:30— core.threadsFromDelveNotes has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbProcess.handleThreadSignals (cyclomatic 21) REDACTED:977— gdbProcess.handleThreadSignals has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbThread.SetReg (cyclomatic 21) REDACTED:2074— gdbThread.SetReg has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbConn.step (cyclomatic 21) pkg/proc/gdbserial/gdbserver_conn.go:610— gdbConn.step has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.advanceRegsDWARF (cyclomatic 21) pkg/proc/stack.go:705— stackIterator.advanceRegsDWARF has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Term.expandPrompt (cyclomatic 21) pkg/terminal/terminal.go:748— Term.expandPrompt has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
api.ParseExamineMemoryArg (cyclomatic 21) service/api/command.go:179— api.ParseExamineMemoryArg has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.targetCmd (cyclomatic 21) service/dap/command.go:271— Session.targetCmd has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onEvaluateRequest (cyclomatic 21) service/dap/server.go:3289— Session.onEvaluateRequest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.setValue (cyclomatic 20) pkg/proc/eval.go:627— EvalScope.setValue has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
processGroup.ContinueOnce (cyclomatic 20) pkg/proc/native/proc.go:269— processGroup.ContinueOnce has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TargetGroup.addTarget (cyclomatic 20) pkg/proc/target_group.go:112— TargetGroup.addTarget has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.mapIterator (cyclomatic 20) pkg/proc/mapiter.go:18— Variable.mapIterator has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
terminal.parseStackArgs (cyclomatic 20) pkg/terminal/command.go:2495— terminal.parseStackArgs has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
api.PrintStack (cyclomatic 20) service/api/prettyprint.go:600— api.PrintStack has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
cmds.New (cyclomatic 19) cmd/dlv/cmds/commands.go:121— cmds.New has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 525, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
EBPFContext.handleParamEvent (cyclomatic 19) REDACTED:409— EBPFContext.handleParamEvent has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
nativeProcess.initialize (cyclomatic 19) pkg/proc/native/proc.go:351— nativeProcess.initialize has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
stackIterator.advanceRegs (cyclomatic 19) pkg/proc/stack.go:568— stackIterator.advanceRegs has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Target.setStackWatchBreakpoints (cyclomatic 19) pkg/proc/stackwatch.go:28— Target.setStackWatchBreakpoints has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
G.Labels (cyclomatic 19) REDACTED:590— G.Labels has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.printcontext (cyclomatic 19) pkg/terminal/command.go:2762— terminal.printcontext has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.target (cyclomatic 19) pkg/terminal/command.go:3573— terminal.target has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ServerImpl.serveJSONCodec (cyclomatic 19) service/rpccommon/server.go:199— ServerImpl.serveJSONCodec has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NormalLocationSpec.Find (cyclomatic 18) pkg/locspec/locations.go:381— NormalLocationSpec.Find has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.GoroutinesInfo (cyclomatic 18) REDACTED:340— proc.GoroutinesInfo has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.evalJump (cyclomatic 18) pkg/proc/eval.go:1473— EvalScope.evalJump has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.evalIndex (cyclomatic 18) pkg/proc/eval.go:2174— EvalScope.evalIndex has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbConn.handshake (cyclomatic 18) pkg/proc/gdbserial/gdbserver_conn.go:101— gdbConn.handshake has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.tryFramePointerUnwind (cyclomatic 18) pkg/proc/stack.go:620— stackIterator.tryFramePointerUnwind has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Variable.reslice (cyclomatic 18) pkg/proc/eval.go:2970— Variable.reslice has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Debugger.Restart (cyclomatic 18) service/debugger/debugger.go:492— Debugger.Restart has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
config.ConfigureSetSimple (cyclomatic 17) pkg/config/split.go:72— config.ConfigureSetSimple has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
line.parseFileEntries5 (cyclomatic 17) pkg/dwarf/line/line_parser.go:289— line.parseFileEntries5 has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
logflags.Setup (cyclomatic 17) pkg/logflags/logflags.go:194— logflags.Setup has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.loadBinaryInfoElf (cyclomatic 17) pkg/proc/bininfo.go:1767— proc.loadBinaryInfoElf has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Function.parse (cyclomatic 17) pkg/proc/bininfo.go:603— Function.parse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
core.readLinuxOrPlatformIndependentCore (cyclomatic 17) pkg/proc/core/linux_core.go:111— core.readLinuxOrPlatformIndependentCore has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SplicedMemory.Add (cyclomatic 17) pkg/proc/core/core.go:43— SplicedMemory.Add has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
EvalScope.ChanGoroutines (cyclomatic 17) pkg/proc/eval.go:246— EvalScope.ChanGoroutines has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 280, 259, 270). 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.
compileCtx.compileTypeCastOrFuncCall (cyclomatic 17) pkg/proc/evalop/evalcompile.go:495— compileCtx.compileTypeCastOrFuncCall has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbConn.readRegisterInfo (cyclomatic 17) pkg/proc/gdbserial/gdbserver_conn.go:287— gdbConn.readRegisterInfo has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.newStackframe (cyclomatic 17) pkg/proc/stack.go:388— stackIterator.newStackframe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
stackIterator.executeFrameRegRule (cyclomatic 17) pkg/proc/stack.go:810— stackIterator.executeFrameRegRule has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Target.shouldDumpMemory (cyclomatic 17) pkg/proc/dump.go:354— Target.shouldDumpMemory has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Variable.registerVariableTypeConv (cyclomatic 17) REDACTED:2219— Variable.registerVariableTypeConv has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
terminal.getLocation (cyclomatic 17) pkg/terminal/command.go:2567— terminal.getLocation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.writeBasicType (cyclomatic 17) service/api/prettyprint.go:217— Variable.writeBasicType has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
frame.parseCIE (cyclomatic 16) pkg/dwarf/frame/parser.go:150— frame.parseCIE has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StateMachine.PCToLine (cyclomatic 16) pkg/dwarf/line/state_machine.go:264— StateMachine.PCToLine has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.allPointers (cyclomatic 16) pkg/proc/fncall.go:735— proc.allPointers has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.resolveCallArgLOONG64 (cyclomatic 16) pkg/proc/loong64_disasm.go:62— proc.resolveCallArgLOONG64 has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
proc.FindGoroutine (cyclomatic 16) REDACTED:407— proc.FindGoroutine has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
proc.resolveCallArgX86 (cyclomatic 16) pkg/proc/x86_disasm.go:70— proc.resolveCallArgX86 has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EvalScope.findGlobalInternal (cyclomatic 16) pkg/proc/eval.go:818— EvalScope.findGlobalInternal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gdbProcess.updateThreadList (cyclomatic 16) REDACTED:1420— gdbProcess.updateThreadList has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nativeProcess.addThread (cyclomatic 16) pkg/proc/native/proc_linux.go:344— nativeProcess.addThread has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TargetGroup.enableBreakpoint (cyclomatic 16) pkg/proc/target_group.go:329— TargetGroup.enableBreakpoint has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Variable.loadMap (cyclomatic 16) REDACTED:2033— Variable.loadMap 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.
Variable.formatTime (cyclomatic 16) REDACTED:2409— Variable.formatTime has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.whatisCommand (cyclomatic 16) pkg/terminal/command.go:2244— terminal.whatisCommand has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.printcontextThread (cyclomatic 16) pkg/terminal/command.go:2849— terminal.printcontextThread has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
terminal.New (cyclomatic 16) pkg/terminal/terminal.go:110— terminal.New has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 146). 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.
Term.sigintGuard (cyclomatic 16) pkg/terminal/terminal.go:259— Term.sigintGuard has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.onRestartRequest (cyclomatic 16) service/dap/server.go:3488— Session.onRestartRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
rpc2.MakeGuessSusbtitutePathIn (cyclomatic 16) service/rpc2/client.go:644— rpc2.MakeGuessSusbtitutePathIn has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
godwarf.readType (cognitive 164) pkg/dwarf/godwarf/type.go:564— godwarf.readType has cognitive complexity 164 (threshold 15). Drivers by points: if/else 42 (105 pts), match/switch 13 (33 pts), jumps 12, loops 6 (11 pts), boolean chains 3 (nesting depth added 88). Of this number, 146 points are the body's own statements and 18 belong to 3 function literals inside it that branch. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
native.trapWaitInternal (cognitive 147) pkg/proc/native/proc_linux.go:440— native.trapWaitInternal has cognitive complexity 147 (threshold 15). Drivers by points: if/else 45 (134 pts), boolean chains 7, loops 2 (6 pts) (nesting depth added 93). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
cmds.traceCmd (cognitive 122) cmd/dlv/cmds/commands.go:672— cmds.traceCmd has cognitive complexity 122 (threshold 15). Drivers by points: if/else 39 (92 pts), loops 6 (21 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 70). None of this is in the body itself: all 122 points belong to one function literal inside it that branches (line 673). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
processGroup.waitForDebugEvent (cognitive 109) REDACTED:345— processGroup.waitForDebugEvent has cognitive complexity 109 (threshold 15). Drivers by points: if/else 27 (95 pts), loops 2 (7 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compileCtx.compileAST (cognitive 101) pkg/proc/evalop/evalcompile.go:293— compileCtx.compileAST has cognitive complexity 101 (threshold 15). Drivers by points: if/else 19 (67 pts), match/switch 9 (23 pts), boolean chains 8, loops 1 (3 pts) (nesting depth added 64). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Variable.findStructMemberOrMethod (cognitive 99) pkg/proc/eval.go:3027— Variable.findStructMemberOrMethod has cognitive complexity 99 (threshold 15). Drivers by points: if/else 29 (85 pts), loops 3 (6 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.traverse (cognitive 98) service/debugger/debugger.go:1424— Debugger.traverse has cognitive complexity 98 (threshold 15). Drivers by points: if/else 23 (78 pts), loops 5 (15 pts), boolean chains 5 (nesting depth added 65). Of this number, 40 points are the body's own statements and 58 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.simpleLocals (cognitive 94) pkg/proc/eval.go:425— EvalScope.simpleLocals has cognitive complexity 94 (threshold 15). Drivers by points: if/else 29 (70 pts), boolean chains 16, loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 45). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
EvalScope.evalTypeCast (cognitive 93) pkg/proc/eval.go:1530— EvalScope.evalTypeCast has cognitive complexity 93 (threshold 15). Drivers by points: if/else 22 (56 pts), match/switch 10 (19 pts), loops 4 (14 pts), boolean chains 4 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onLaunchRequest (cognitive 84) service/dap/server.go:1053— Session.onLaunchRequest has cognitive complexity 84 (threshold 15). Drivers by points: if/else 43 (71 pts), loops 4 (6 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 31). Of this number, 66 points are the body's own statements and 18 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.loadDebugInfoMaps (cognitive 83) pkg/proc/bininfo.go:2760— BinaryInfo.loadDebugInfoMaps has cognitive complexity 83 (threshold 15). Drivers by points: if/else 25 (69 pts), loops 4 (8 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Session.onThreadsRequest (cognitive 81) service/dap/server.go:2177— Session.onThreadsRequest has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 4 (14 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 49). Of this number, 74 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
BinaryInfo.loadDebugInfoMapsCompileUnit (cognitive 74) pkg/proc/bininfo.go:2943— BinaryInfo.loadDebugInfoMapsCompileUnit has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (68 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
G.Labels (cognitive 74) REDACTED:590— G.Labels has cognitive complexity 74 (threshold 15). Drivers by points: if/else 12 (57 pts), loops 2 (11 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 57). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
terminal.printTracepoint (cognitive 74) pkg/terminal/command.go:3004— terminal.printTracepoint has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (60 pts), loops 3 (9 pts), boolean chains 5 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
mapIteratorSwiss.next (cognitive 70) pkg/proc/mapiter.go:521— mapIteratorSwiss.next has cognitive complexity 70 (threshold 15). Drivers by points: if/else 19 (57 pts), boolean chains 7, loops 3 (6 pts) (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.Command (cognitive 70) service/debugger/debugger.go:1099— Debugger.Command has cognitive complexity 70 (threshold 15). Drivers by points: if/else 30 (60 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.convertVariableWithOpts (cognitive 68) service/dap/server.go:3125— Session.convertVariableWithOpts has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (61 pts), boolean chains 6, match/switch 1 (nesting depth added 31). Of this number, 65 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
debugger.guessSubstitutePath (cognitive 68) service/debugger/debugger.go:2695— debugger.guessSubstitutePath has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (46 pts), loops 10 (16 pts), boolean chains 6 (nesting depth added 35). Of this number, 61 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.arm64SwitchStack (cognitive 67) pkg/proc/arm64_arch.go:147— proc.arm64SwitchStack has cognitive complexity 67 (threshold 15). Drivers by points: if/else 25 (57 pts), boolean chains 8, match/switch 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.breakpoints (cognitive 67) pkg/terminal/command.go:1724— terminal.breakpoints has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (58 pts), loops 3 (5 pts), match/switch 1 (3 pts), jumps 1 (nesting depth added 38). Of this number, 65 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.writeTo (cognitive 67) service/api/prettyprint.go:94— Variable.writeTo has cognitive complexity 67 (threshold 15). Drivers by points: if/else 32 (56 pts), boolean chains 6, loops 1 (4 pts), match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.loadValueInternal (cognitive 64) REDACTED:1362— Variable.loadValueInternal has cognitive complexity 64 (threshold 15). Drivers by points: if/else 21 (50 pts), boolean chains 6, match/switch 3 (5 pts), loops 1 (3 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Term.Run (cognitive 63) pkg/terminal/terminal.go:325— Term.Run has cognitive complexity 63 (threshold 15). Drivers by points: if/else 21 (44 pts), loops 7 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 33). Of this number, 37 points are the body's own statements and 26 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
goversion.Parse (cognitive 61) pkg/goversion/go_version.go:40— goversion.Parse has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 7, loops 2 (7 pts), match/switch 2 (5 pts) (nesting depth added 33). Of this number, 58 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbThread.reloadRegisters (cognitive 60) REDACTED:1693— gdbThread.reloadRegisters has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 5 (19 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.parseStopPacket (cognitive 60) pkg/proc/gdbserial/gdbserver_conn.go:759— gdbConn.parseStopPacket has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (42 pts), loops 3 (8 pts), match/switch 3 (6 pts), boolean chains 4 (nesting depth added 36). Of this number, 44 points are the body's own statements and 16 belong to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
gdbserial.LLDBLaunch (cognitive 58) REDACTED:462— gdbserial.LLDBLaunch has cognitive complexity 58 (threshold 15). Drivers by points: if/else 26 (45 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.FindFileLocation (cognitive 57) pkg/proc/bininfo.go:177— proc.FindFileLocation has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 10 (18 pts), boolean chains 7 (nesting depth added 27). Of this number, 51 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evalStack.executeOp (cognitive 57) pkg/proc/eval.go:1111— evalStack.executeOp has cognitive complexity 57 (threshold 15). Drivers by points: if/else 26 (52 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 27). Of this number, 56 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.funcCallStep (cognitive 56) pkg/proc/fncall.go:811— proc.funcCallStep has cognitive complexity 56 (threshold 15). Drivers by points: if/else 23 (46 pts), loops 2 (5 pts), boolean chains 4, match/switch 1 (nesting depth added 26). Of this number, 51 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.childrenToDAPVariables (cognitive 56) service/dap/server.go:2855— Session.childrenToDAPVariables has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (37 pts), match/switch 3 (7 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 33). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Debugger.CreateBreakpoint (cognitive 55) service/debugger/debugger.go:695— Debugger.CreateBreakpoint has cognitive complexity 55 (threshold 15). Drivers by points: if/else 22 (39 pts), loops 4 (13 pts), boolean chains 1, jumps 1, match/switch 1 (nesting depth added 26). Of this number, 52 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.setBreakpoint (cognitive 54) pkg/terminal/command.go:1889— terminal.setBreakpoint has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (41 pts), loops 3 (6 pts), boolean chains 4, match/switch 3 (nesting depth added 21). Of this number, 47 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Term.handleExit (cognitive 52) pkg/terminal/terminal.go:555— Term.handleExit has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (51 pts), boolean chains 1 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
core.threadsFromDelveNotes (cognitive 49) pkg/proc/core/delve_core.go:30— core.threadsFromDelveNotes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 30). Of this number, 40 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mapIteratorSwiss.loadTypes (cognitive 49) pkg/proc/mapiter.go:406— mapIteratorSwiss.loadTypes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 4 (12 pts), loops 4 (8 pts), boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
native.stop1 (cognitive 49) pkg/proc/native/proc_linux.go:838— native.stop1 has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
gdbConn.recv (cognitive 47) pkg/proc/gdbserial/gdbserver_conn.go:1370— gdbConn.recv has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (43 pts), boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.shortenTypeEx (cognitive 47) service/api/shorten_type.go:16— api.shortenTypeEx has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (9 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BinaryInfo.openSeparateDebugInfo (cognitive 46) pkg/proc/bininfo.go:1633— BinaryInfo.openSeparateDebugInfo has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 3, loops 1 (nesting depth added 19). Of this number, 39 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.runUntilStopAndNotify (cognitive 45) service/dap/server.go:4417— Session.runUntilStopAndNotify has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cmds.execute (cognitive 44) cmd/dlv/cmds/commands.go:1067— cmds.execute has cognitive complexity 44 (threshold 15). Drivers by points: if/else 22 (33 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.rangeFuncStackTrace (cognitive 44) pkg/proc/stack.go:1161— proc.rangeFuncStackTrace has cognitive complexity 44 (threshold 15). Drivers by points: if/else 25 (35 pts), boolean chains 7, loops 1, match/switch 1 (nesting depth added 10). Most of this is not in the body itself: 6 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1224, 1197, 1189). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
colorize.Print (cognitive 44) pkg/terminal/colorize/colorize.go:30— colorize.Print has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (29 pts), loops 6 (10 pts), boolean chains 4, match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 10 of the 44 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 97, 69, 155). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
minidump.Open (cognitive 43) REDACTED:320— minidump.Open has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.targetCmd (cognitive 43) service/dap/command.go:271— Session.targetCmd has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (35 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 25). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EvalScope.evalCallInjectionStart (cognitive 42) pkg/proc/fncall.go:246— EvalScope.evalCallInjectionStart has cognitive complexity 42 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerImpl.serveJSONCodec (cognitive 42) service/rpccommon/server.go:199— ServerImpl.serveJSONCodec has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (39 pts), boolean chains 2, loops 1 (nesting depth added 22). Of this number, 34 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.parseG (cognitive 41) REDACTED:905— Variable.parseG has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26 (33 pts), boolean chains 7, loops 1 (nesting depth added 7). Of this number, 39 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
proc.riscv64SwitchStack (cognitive 40) pkg/proc/riscv64_arch.go:138— proc.riscv64SwitchStack has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 6, match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
processGroup.ContinueOnce (cognitive 40) pkg/proc/native/proc.go:269— processGroup.ContinueOnce has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 5 (14 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mapIteratorClassic.nextBucket (cognitive 39) pkg/proc/mapiter.go:135— mapIteratorClassic.nextBucket has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.amd64SwitchStack (cognitive 38) pkg/proc/amd64_arch.go:136— proc.amd64SwitchStack has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 7, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbProcess.ContinueOnce (cognitive 38) REDACTED:848— gdbProcess.ContinueOnce has cognitive complexity 38 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 3 (4 pts), boolean chains 2, jumps 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stackIterator.advanceRegsDWARF (cognitive 38) pkg/proc/stack.go:705— stackIterator.advanceRegsDWARF has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.ParseExamineMemoryArg (cognitive 38) service/api/command.go:179— api.ParseExamineMemoryArg has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (29 pts), jumps 3, boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 19). Of this number, 35 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onEvaluateRequest (cognitive 38) service/dap/server.go:3289— Session.onEvaluateRequest has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 5, loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.ppc64leSwitchStack (cognitive 37) pkg/proc/ppc64le_arch.go:105— proc.ppc64leSwitchStack has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starbind.unmarshalStarlarkValueIntl (cognitive 37) pkg/terminal/starbind/conv.go:623— starbind.unmarshalStarlarkValueIntl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (5 pts), match/switch 2 (3 pts) (nesting depth added 19). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.typeCastCompatibleTypes (cognitive 36) pkg/proc/eval.go:1813— proc.typeCastCompatibleTypes has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (30 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BreakpointState.checkCond (cognitive 36) pkg/proc/breakpoints.go:294— BreakpointState.checkCond has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.evalBinary (cognitive 36) pkg/proc/eval.go:2506— EvalScope.evalBinary has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.structField (cognitive 36) REDACTED:1160— Variable.structField has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Term.sigintGuard (cognitive 36) pkg/terminal/terminal.go:259— Term.sigintGuard has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.setBreakpoints (cognitive 36) service/dap/server.go:1718— Session.setBreakpoints has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (32 pts), boolean chains 2, loops 2 (nesting depth added 20). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Session.onExceptionInfoRequest (cognitive 36) service/dap/server.go:4114— Session.onExceptionInfoRequest has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stackIterator.Next (cognitive 35) pkg/proc/stack.go:266— stackIterator.Next has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
locspec.SubstitutePath (cognitive 34) pkg/locspec/locations.go:562— locspec.SubstitutePath has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.compareOp (cognitive 34) pkg/proc/eval.go:2618— proc.compareOp has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 5 (9 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.parseStackArgs (cognitive 34) pkg/terminal/command.go:2495— terminal.parseStackArgs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 22). Of this number, 28 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.loong64SwitchStack (cognitive 33) pkg/proc/loong64_arch.go:119— proc.loong64SwitchStack has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 7, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.macOSDebugFrameBugWorkaround (cognitive 33) pkg/proc/bininfo.go:2298— BinaryInfo.macOSDebugFrameBugWorkaround has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.handshake (cognitive 33) pkg/proc/gdbserial/gdbserver_conn.go:101— gdbConn.handshake has cognitive complexity 33 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.step (cognitive 33) pkg/proc/gdbserial/gdbserver_conn.go:610— gdbConn.step has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetGroup.addTarget (cognitive 33) pkg/proc/target_group.go:112— TargetGroup.addTarget has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 3, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.target (cognitive 33) pkg/terminal/command.go:3573— terminal.target has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
gdbRegisters.Slice (cognitive 32) REDACTED:2148— gdbRegisters.Slice has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.readRegisterInfo (cognitive 32) pkg/proc/gdbserial/gdbserver_conn.go:287— gdbConn.readRegisterInfo has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stackIterator.advanceRegs (cognitive 32) pkg/proc/stack.go:568— stackIterator.advanceRegs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 7, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Defer.load (cognitive 32) pkg/proc/stack.go:952— Defer.load has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (6 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Term.expandPrompt (cognitive 32) pkg/terminal/terminal.go:748— Term.expandPrompt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 17). Of this number, 26 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.setBreakpointInternal (cognitive 31) pkg/proc/breakpoints.go:793— Target.setBreakpointInternal has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). Of this number, 20 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
starbind.New (cognitive 31) REDACTED:69— starbind.New has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 3 (6 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 10). None of this is in the body itself: all 31 points belong to 5 function literals inside it that branch (lines 164, 85, 105, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
core.readNote (cognitive 30) pkg/proc/core/linux_core.go:299— core.readNote has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commands.help (cognitive 30) pkg/terminal/command.go:781— Commands.help has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.ParseGoroutineArgs (cognitive 30) service/api/command.go:35— api.ParseGoroutineArgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (26 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.collectBreakpointInformation (cognitive 30) service/debugger/debugger.go:1291— Debugger.collectBreakpointInformation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.Locals (cognitive 29) pkg/proc/eval.go:331— EvalScope.Locals has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, loops 4 (nesting depth added 7). Of this number, 24 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.findGlobalInternal (cognitive 29) pkg/proc/eval.go:818— EvalScope.findGlobalInternal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (5 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.evalIndex (cognitive 29) pkg/proc/eval.go:2174— EvalScope.evalIndex has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.Dump (cognitive 29) pkg/proc/dump.go:96— Target.Dump has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 3 (4 pts), match/switch 2, boolean chains 1 (nesting depth added 9). Of this number, 25 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.setStackWatchBreakpoints (cognitive 29) pkg/proc/stackwatch.go:28— Target.setStackWatchBreakpoints has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.getLocation (cognitive 29) pkg/terminal/command.go:2567— terminal.getLocation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 2, match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
terminal.printcontext (cognitive 29) pkg/terminal/command.go:2762— terminal.printcontext has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commands.goroutines (cognitive 29) pkg/terminal/command.go:923— Commands.goroutines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.ConfigureSetSimple (cognitive 28) pkg/config/split.go:72— config.ConfigureSetSimple has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 1, match/switch 1 (nesting depth added 14). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
line.parseIncludeDirs5 (cognitive 28) pkg/dwarf/line/line_parser.go:177— line.parseIncludeDirs5 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (7 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NormalLocationSpec.Find (cognitive 28) pkg/locspec/locations.go:381— NormalLocationSpec.Find has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.loadBinaryInfoElf (cognitive 28) pkg/proc/bininfo.go:1767— proc.loadBinaryInfoElf has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (28 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.breakpointConditionSatisfiable (cognitive 28) pkg/proc/breakpoints.go:1243— proc.breakpointConditionSatisfiable has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, match/switch 4 (5 pts) (nesting depth added 5). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1301, 1269, 1260). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
proc.i386SwitchStack (cognitive 28) pkg/proc/i386_arch.go:119— proc.i386SwitchStack has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbProcess.updateThreadList (cognitive 28) REDACTED:1420— gdbProcess.updateThreadList has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbThread.SetReg (cognitive 28) REDACTED:2074— gdbThread.SetReg has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
api.PrintStack (cognitive 28) service/api/prettyprint.go:600— api.PrintStack has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 5 (8 pts), boolean chains 2 (nesting depth added 10). Of this number, 25 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onAttachRequest (cognitive 28) service/dap/server.go:2322— Session.onAttachRequest has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
debugger.attachErrorMessageLinux (cognitive 28) service/debugger/debugger_linux.go:18— debugger.attachErrorMessageLinux has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
line.parseFileEntries5 (cognitive 27) pkg/dwarf/line/line_parser.go:289— line.parseFileEntries5 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.newCompositeMemory (cognitive 27) pkg/proc/mem.go:132— proc.newCompositeMemory has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.newVariable (cognitive 27) REDACTED:686— proc.newVariable has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StateMachine.PCToLine (cognitive 26) pkg/dwarf/line/state_machine.go:264— StateMachine.PCToLine has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
op.PrettyPrint (cognitive 26) pkg/dwarf/op/op.go:108— op.PrettyPrint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.negotiateType (cognitive 26) pkg/proc/eval.go:2442— proc.negotiateType has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.GoroutinesInfo (cognitive 26) REDACTED:340— proc.GoroutinesInfo has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 3, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbProcess.handleThreadSignals (cognitive 26) REDACTED:977— gdbProcess.handleThreadSignals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetGroup.enableBreakpoint (cognitive 26) pkg/proc/target_group.go:329— TargetGroup.enableBreakpoint has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (2 pts), jumps 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rpc2.MakeGuessSusbtitutePathIn (cognitive 26) service/rpc2/client.go:644— rpc2.MakeGuessSusbtitutePathIn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reader.FindEntryNamed (cognitive 25) pkg/dwarf/reader/reader.go:136— Reader.FindEntryNamed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evalStack.run (cognitive 25) pkg/proc/eval.go:1026— evalStack.run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onRestartRequest (cognitive 25) service/dap/server.go:3488— Session.onRestartRequest has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
frame.parseCIE (cognitive 24) pkg/dwarf/frame/parser.go:150— frame.parseCIE has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.loadDebugInfoMapsInlinedCalls (cognitive 24) pkg/proc/bininfo.go:3174— BinaryInfo.loadDebugInfoMapsInlinedCalls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.ChanGoroutines (cognitive 24) pkg/proc/eval.go:246— EvalScope.ChanGoroutines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 2 (nesting depth added 7). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 280, 259, 270). 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.
nativeProcess.addThread (cognitive 24) pkg/proc/native/proc_linux.go:344— nativeProcess.addThread has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stackIterator.readSigtrampgoContext (cognitive 24) REDACTED:15— stackIterator.readSigtrampgoContext has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 4 (7 pts), loops 1 (nesting depth added 9). Of this number, 17 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.isType (cognitive 24) pkg/proc/eval.go:2779— Variable.isType has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.resolveCallArgLOONG64 (cognitive 23) pkg/proc/loong64_disasm.go:62— proc.resolveCallArgLOONG64 has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 4 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Function.parse (cognitive 23) pkg/proc/bininfo.go:603— Function.parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
core.readLinuxOrPlatformIndependentCore (cognitive 23) pkg/proc/core/linux_core.go:111— core.readLinuxOrPlatformIndependentCore has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbProcess.initialize (cognitive 23) REDACTED:701— gdbProcess.initialize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compositeMemory.WriteMemory (cognitive 23) pkg/proc/mem.go:187— compositeMemory.WriteMemory has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.SetWatchpoint (cognitive 23) pkg/proc/breakpoints.go:720— Target.SetWatchpoint has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
terminal.whatisCommand (cognitive 23) pkg/terminal/command.go:2244— terminal.whatisCommand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
debugger.New (cognitive 23) service/debugger/debugger.go:167— debugger.New has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.Restart (cognitive 23) service/debugger/debugger.go:492— Debugger.Restart has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.FindGoroutine (cognitive 22) REDACTED:407— proc.FindGoroutine has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbserial.LLDBAttach (cognitive 22) REDACTED:600— gdbserial.LLDBAttach has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbThread.SetCurrentBreakpoint (cognitive 22) REDACTED:1964— gdbThread.SetCurrentBreakpoint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EBPFContext.handleParamEvent (cognitive 22) REDACTED:409— EBPFContext.handleParamEvent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
lineWriter.Write (cognitive 22) pkg/terminal/colorize/colorize.go:280— lineWriter.Write has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.New (cognitive 22) pkg/terminal/terminal.go:110— terminal.New has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 146). 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.
Variable.writeBasicType (cognitive 22) service/api/prettyprint.go:217— Variable.writeBasicType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dap.parseLogPoint (cognitive 22) service/dap/server.go:4727— dap.parseLogPoint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cmds.New (cognitive 21) cmd/dlv/cmds/commands.go:121— cmds.New has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 525, 188, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
formReader.next (cognitive 21) pkg/dwarf/line/parse_util.go:85— formReader.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NormalLocationSpec.findFuncCandidates (cognitive 21) pkg/locspec/locations.go:445— NormalLocationSpec.findFuncCandidates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbserial.wiredecode (cognitive 21) pkg/proc/gdbserial/gdbserver_conn.go:1480— gdbserial.wiredecode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
stackIterator.newStackframe (cognitive 21) pkg/proc/stack.go:388— stackIterator.newStackframe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.setEBPFTracepointOnFunc (cognitive 21) pkg/proc/breakpoints.go:611— Target.setEBPFTracepointOnFunc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.loadSliceInfo (cognitive 21) REDACTED:1639— Variable.loadSliceInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.loadMap (cognitive 21) REDACTED:2033— Variable.loadMap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, 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.
terminal.examineMemoryCmd (cognitive 21) pkg/terminal/command.go:2138— terminal.examineMemoryCmd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.configureSetSubstitutePath (cognitive 21) pkg/terminal/config.go:75— terminal.configureSetSubstitutePath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.arm64LinkerTrampolineTarget (cognitive 20) pkg/proc/arm64_disasm.go:78— proc.arm64LinkerTrampolineTarget has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.funcCallArgs (cognitive 20) pkg/proc/fncall.go:610— proc.funcCallArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbProcess.setCurrentBreakpoints (cognitive 20) REDACTED:1481— gdbProcess.setCurrentBreakpoints has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.registerVariableTypeConv (cognitive 20) REDACTED:2219— Variable.registerVariableTypeConv has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.formatBreakpointAttrs (cognitive 20) pkg/terminal/command.go:1842— terminal.formatBreakpointAttrs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
terminal.printcontextThread (cognitive 20) pkg/terminal/command.go:2849— terminal.printcontextThread has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commands.printGoroutines (cognitive 20) pkg/terminal/command.go:893— Commands.printGoroutines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.CheckStopLocation (cognitive 20) service/dap/daptest/client.go:193— Client.CheckStopLocation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onScopesRequest (cognitive 20) service/dap/server.go:2666— Session.onScopesRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
reader.variablesInternal (cognitive 19) pkg/dwarf/reader/variables.go:41— reader.variablesInternal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (3 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
proc.loadBinaryInfoMacho (cognitive 19) pkg/proc/bininfo.go:2198— proc.loadBinaryInfoMacho has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.findTypeExpr (cognitive 19) pkg/proc/bininfo.go:2663— BinaryInfo.findTypeExpr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compileCtx.compileTypeCastOrFuncCall (cognitive 19) pkg/proc/evalop/evalcompile.go:495— compileCtx.compileTypeCastOrFuncCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbThread.reloadGAtPC (cognitive 19) REDACTED:1822— gdbThread.reloadGAtPC has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.clearAll (cognitive 19) pkg/terminal/command.go:1665— terminal.clearAll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.writeStructTo (cognitive 19) service/api/prettyprint.go:312— Variable.writeStructTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.writeMapTo (cognitive 19) service/api/prettyprint.go:356— Variable.writeMapTo has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.newNoDebugProcess (cognitive 19) service/dap/server.go:1417— Session.newNoDebugProcess has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (2 pts) (nesting depth added 7). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.stopDebugSession (cognitive 19) service/dap/server.go:1577— Session.stopDebugSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugLineInfo.PrologueEndPC (cognitive 18) pkg/dwarf/line/state_machine.go:330— DebugLineInfo.PrologueEndPC has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.callInjectionProtocol (cognitive 18) pkg/proc/fncall.go:1151— proc.callInjectionProtocol has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.resolveCallArgX86 (cognitive 18) pkg/proc/x86_disasm.go:70— proc.resolveCallArgX86 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, match/switch 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
core.buildMemory (cognitive 18) pkg/proc/core/linux_core.go:415— core.buildMemory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
debuginfod.execFind (cognitive 18) pkg/proc/debuginfod/debuginfod.go:16— debuginfod.execFind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 31, 43). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
stackIterator.tryFramePointerUnwind (cognitive 18) pkg/proc/stack.go:620— stackIterator.tryFramePointerUnwind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TargetGroup.disableBreakpoint (cognitive 18) pkg/proc/target_group.go:416— TargetGroup.disableBreakpoint has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.reslice (cognitive 18) pkg/proc/eval.go:2970— Variable.reslice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), 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.
G.readDefers (cognitive 18) pkg/proc/stack.go:903— G.readDefers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Commands.onCmd (cognitive 18) pkg/terminal/command.go:3233— Commands.onCmd has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.ServeDAPCodec (cognitive 18) service/dap/server.go:649— Session.ServeDAPCodec has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 11). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onSetVariableRequest (cognitive 18) service/dap/server.go:3610— Session.onSetVariableRequest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.state (cognitive 18) service/debugger/debugger.go:589— Debugger.state has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RPCClient.continueDir (cognitive 18) service/rpc2/client.go:117— RPCClient.continueDir has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). None of this is in the body itself: all 18 points belong to one function literal inside it that branches (line 119). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
RPCServer.ListGoroutines (cognitive 18) service/rpc2/server.go:718— RPCServer.ListGoroutines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cmds.dapCmd (cognitive 17) cmd/dlv/cmds/commands.go:547— cmds.dapCmd has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16 (17 pts) (nesting depth added 1). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 548). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
config.SplitQuotedFields (cognitive 17) pkg/config/split.go:16— config.SplitQuotedFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugLineInfo.FirstStmt (cognitive 17) pkg/dwarf/line/state_machine.go:359— DebugLineInfo.FirstStmt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
goversion.Compatible (cognitive 17) pkg/goversion/compat.go:26— goversion.Compatible has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.FirstPCAfterPrologue (cognitive 17) pkg/proc/bininfo.go:393— proc.FirstPCAfterPrologue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.minmaxBuiltin (cognitive 17) pkg/proc/eval.go:2075— proc.minmaxBuiltin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.allPointers (cognitive 17) pkg/proc/fncall.go:735— proc.allPointers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.AddImage (cognitive 17) pkg/proc/bininfo.go:1158— BinaryInfo.AddImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.setValue (cognitive 17) pkg/proc/eval.go:627— EvalScope.setValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.waitForvContStop (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:694— gdbConn.waitForvContStop has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.queryThreads (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:942— gdbConn.queryThreads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.send (cognitive 17) pkg/proc/gdbserial/gdbserver_conn.go:1331— gdbConn.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Target.ClearSteppingBreakpoints (cognitive 17) pkg/proc/breakpoints.go:943— Target.ClearSteppingBreakpoints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Target.clearInactivatedSteppingBreakpoint) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Target.clearInactivatedSteppingBreakpoint (cognitive 17) pkg/proc/breakpoints.go:967— Target.clearInactivatedSteppingBreakpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Target.ClearSteppingBreakpoints) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TargetGroup.ChangeBreakpointCondition (cognitive 17) pkg/proc/target_group.go:449— TargetGroup.ChangeBreakpointCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TargetGroup.manageUnsatisfiableBreakpoints (cognitive 17) pkg/proc/target_group.go:534— TargetGroup.manageUnsatisfiableBreakpoints has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.mapAccess (cognitive 17) pkg/proc/eval.go:2900— Variable.mapAccess has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Variable.formatTime (cognitive 17) REDACTED:2409— Variable.formatTime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.continueUntilCompleteNext (cognitive 17) pkg/terminal/command.go:1402— terminal.continueUntilCompleteNext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.disassCommand (cognitive 17) pkg/terminal/command.go:2660— terminal.disassCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.printBreakpointInfo (cognitive 17) pkg/terminal/command.go:2948— terminal.printBreakpointInfo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 3). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pagingWriter.Write (cognitive 17) pkg/terminal/out.go:115— pagingWriter.Write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
starbind.rep (cognitive 17) pkg/terminal/starbind/repl.go:83— starbind.rep has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Session.onDataBreakpointInfoRequest (cognitive 17) service/dap/server.go:1937— Session.onDataBreakpointInfoRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.onDisassembleRequest (cognitive 17) service/dap/server.go:3884— Session.onDisassembleRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.Launch (cognitive 17) service/debugger/debugger.go:277— Debugger.Launch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (nesting depth added 7). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Debugger.Functions (cognitive 17) service/debugger/debugger.go:1393— Debugger.Functions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugLineInfo.AllPCsBetween (cognitive 16) pkg/dwarf/line/state_machine.go:175— DebugLineInfo.AllPCsBetween has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.runtimeOptimizedWorkaround (cognitive 16) pkg/proc/fncall.go:1293— proc.runtimeOptimizedWorkaround has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proc.GetG (cognitive 16) REDACTED:282— proc.GetG has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BinaryInfo.setGStructOffsetPE (cognitive 16) pkg/proc/bininfo.go:2137— BinaryInfo.setGStructOffsetPE has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2138). 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.
BinaryInfo.ListPackagesBuildInfo (cognitive 16) pkg/proc/bininfo.go:3353— BinaryInfo.ListPackagesBuildInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SplicedMemory.Add (cognitive 16) pkg/proc/core/core.go:43— SplicedMemory.Add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EvalScope.evalJump (cognitive 16) pkg/proc/eval.go:1473— EvalScope.evalJump has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, match/switch 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gdbConn.memoryRegionInfo (cognitive 16) pkg/proc/gdbserial/gdbserver_conn.go:1271— gdbConn.memoryRegionInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nativeThread.SetCurrentBreakpoint (cognitive 16) pkg/proc/native/threads.go:93— nativeThread.SetCurrentBreakpoint has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 1 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
terminal.restartRecorded (cognitive 16) pkg/terminal/command.go:1211— terminal.restartRecorded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
terminal.configureSetDebugInfoDirectories (cognitive 16) pkg/terminal/config.go:153— terminal.configureSetDebugInfoDirectories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Env.variableValueToStarlarkValue (cognitive 16) pkg/terminal/starbind/conv.go:242— Env.variableValueToStarlarkValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerImpl.Run (cognitive 16) service/rpccommon/server.go:106— ServerImpl.Run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 135). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
Near-duplicate member pair (51 shared lines) pkg/proc/arm64_arch.go:147— pkg/proc/arm64_arch.go:147-356 | pkg/proc/ppc64le_arch.go:105-229 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) pkg/proc/amd64_arch.go:50— pkg/proc/amd64_arch.go:50-129 | pkg/proc/arm64_arch.go:61-142 | pkg/proc/i386_arch.go:43-116 | pkg/proc/loong64_arch.go:48-115 | pkg/proc/ppc64le_arch.go:49-100 | pkg/proc/riscv64_arch.go:51-134 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) pkg/proc/linutil/regs_arm64_arch.go:126— pkg/proc/linutil/regs_arm64_arch.go:126-146 | pkg/proc/linutil/regs_loong64_arch.go:140-163 | pkg/proc/linutil/regs_ppc64le_arch.go:145-165 | pkg/proc/linutil/regs_riscv64_arch.go:168-191 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (36 lines × 2) pkg/proc/fbsdutil/regs.go:188— pkg/proc/fbsdutil/regs.go:188-223 | pkg/proc/linutil/regs_amd64_arch.go:162-197 — before extracting anything, compare `pkg/proc/fbsdutil/regs.go` and `pkg/proc/linutil/regs_amd64_arch.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/fbsdutil/regs.go:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (34–35 lines × 3) pkg/proc/amd64_arch.go:221— pkg/proc/amd64_arch.go:221-255 | pkg/proc/i386_arch.go:147-181 | pkg/proc/riscv64_arch.go:243-276 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/i386_arch.go` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 108 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32–33 lines × 2) pkg/proc/arm64_arch.go:316— pkg/proc/arm64_arch.go:316-347 | pkg/proc/ppc64le_arch.go:187-219 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/ppc64le_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 114 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/ppc64le_arch.go:187` 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 (3–26 lines × 4) pkg/proc/arm64_arch.go:256— pkg/proc/arm64_arch.go:256-258 | pkg/proc/loong64_arch.go:212-237 | pkg/proc/ppc64le_arch.go:144-146 | pkg/proc/riscv64_arch.go:235-260 — before extracting anything, compare `pkg/proc/arm64_arch.go` and `pkg/proc/loong64_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/arm64_arch.go:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (24 lines × 2) pkg/proc/loong64_arch.go:170— pkg/proc/loong64_arch.go:170-193 | pkg/proc/riscv64_arch.go:193-216 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) pkg/proc/eval.go:3053— pkg/proc/eval.go:3053-3075 | REDACTED:1181-1203 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:3053` 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 (22 lines × 3) pkg/proc/amd64_arch.go:174— pkg/proc/amd64_arch.go:174-195 | pkg/proc/loong64_arch.go:172-193 | pkg/proc/riscv64_arch.go:195-216 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/loong64_arch.go` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) REDACTED:104— REDACTED:104-124 | pkg/proc/native/proc.go:467-487 — 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 `REDACTED:104` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) pkg/proc/eval.go:3028— pkg/proc/eval.go:3028-3047 | REDACTED:1161-1180 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/eval.go:3028` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–18 lines × 2) pkg/dwarf/godwarf/addr.go:25— pkg/dwarf/godwarf/addr.go:25-37 | pkg/dwarf/loclist/dwarf5_loclist.go:27-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/dwarf/godwarf/addr.go:25` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13–16 lines × 5) pkg/proc/linutil/regs_amd64_arch.go:93— pkg/proc/linutil/regs_amd64_arch.go:93-105 | pkg/proc/linutil/regs_arm64_arch.go:78-90 | pkg/proc/linutil/regs_loong64_arch.go:84-99 | pkg/proc/linutil/regs_ppc64le_arch.go:130-142 | pkg/proc/linutil/regs_riscv64_arch.go:111-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/linutil/regs_amd64_arch.go:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) pkg/proc/loong64_arch.go:196— pkg/proc/loong64_arch.go:196-209 | pkg/proc/riscv64_arch.go:219-232 — before extracting anything, compare `pkg/proc/loong64_arch.go` and `pkg/proc/riscv64_arch.go` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 6) pkg/proc/amd64_arch.go:94— pkg/proc/amd64_arch.go:94-104 | pkg/proc/arm64_arch.go:105-115 | pkg/proc/i386_arch.go:87-99 | pkg/proc/loong64_arch.go:81-91 | pkg/proc/ppc64le_arch.go:74-85 | pkg/proc/riscv64_arch.go:99-109 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/arm64_arch.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/amd64_arch.go:94` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–13 lines × 4) pkg/proc/linutil/regs_arm64_arch.go:136— pkg/proc/linutil/regs_arm64_arch.go:136-146 | pkg/proc/linutil/regs_loong64_arch.go:151-163 | pkg/proc/linutil/regs_ppc64le_arch.go:155-165 | pkg/proc/linutil/regs_riscv64_arch.go:179-191 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/linutil/regs_arm64_arch.go:136` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 4) pkg/proc/amd64_arch.go:233— pkg/proc/amd64_arch.go:233-244 | pkg/proc/arm64_arch.go:277-288 | pkg/proc/i386_arch.go:159-170 | pkg/proc/riscv64_arch.go:255-266 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/arm64_arch.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 3) service/debugger/debugger.go:1370— service/debugger/debugger.go:1370-1380 | service/debugger/debugger.go:1394-1404 | service/debugger/debugger.go:1631-1642 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `service/debugger/debugger.go:1370` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (12 lines × 3) service/rpc2/server.go:178— service/rpc2/server.go:178-189 | service/rpc2/server.go:344-355 | service/rpc2/server.go:376-387 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 5) pkg/proc/amd64_arch.go:137— pkg/proc/amd64_arch.go:137-147 | pkg/proc/arm64_arch.go:149-159 | pkg/proc/i386_arch.go:120-130 | pkg/proc/loong64_arch.go:120-130 | pkg/proc/riscv64_arch.go:139-149 — before extracting anything, compare `pkg/proc/amd64_arch.go` and `pkg/proc/arm64_arch.go` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/amd64_arch.go:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) pkg/proc/fbsdutil/regs.go:174— pkg/proc/fbsdutil/regs.go:174-184 | pkg/proc/linutil/regs_amd64_arch.go:148-158 | pkg/proc/linutil/regs_i386_arch.go:130-140 — before extracting anything, compare `pkg/proc/fbsdutil/regs.go` and `pkg/proc/linutil/regs_amd64_arch.go` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/fbsdutil/regs.go:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) REDACTED:644— REDACTED:644-653 | REDACTED:704-713 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) REDACTED:1718— REDACTED:1718-1724 | REDACTED:1738-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1718` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) REDACTED:541— REDACTED:541-546 | REDACTED:827-832 | REDACTED:906-911 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) REDACTED:106— REDACTED:106-110 | REDACTED:122-126 | REDACTED:140-144 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) pkg/proc/bininfo.go:2485— pkg/proc/bininfo.go:2485-2496 | pkg/proc/bininfo.go:2541-2552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pkg/proc/bininfo.go:2485` 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.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×1
Length read from the parsed input is spent without ever being bounded pkg/dwarf/godwarf/sections.go:112— `dlen` is read from the bytes being parsed at line 111 (`binary.BigEndian.Uint64`), then used to size a `make([]byte, …)` at line 112 — and nowhere in its scope is `dlen` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: `make` reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the runtime cannot satisfy is `fatal error: out of memory` — not a panic, so no `recover` intercepts it and the whole process dies; a 64-bit length too large to represent panics with `makeslice: len out of range` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `dlen` against the bytes actually remaining and a maximum the format allows before allocating.
Collection crosses a callback boundary unsynchronised _scripts/gen-capslock-all.go:67— `main` starts a goroutine on every pass of a loop, and each one writes `failedPlatforms`, a slice declared before the loop — `failedPlatforms = append(failedPlatforms, …)` on line 67. The loop never waits on `wg` before its next pass, so the goroutines of successive passes run at the same time and each one's write races the next one's; waiting on `wg` after the loop orders only what follows the wait. `failedPlatforms = append(failedPlatforms, …)` rewrites the slice variable itself — its pointer, length and capacity — so the other side reads or rewrites a variable mid-update: an append is lost, or a read sees a length its backing array does not have. `wg` is a `sync.WaitGroup`, which orders the handoff's signal and takes no exclusion over the slice's own state. Guard every write to `failedPlatforms` with one `sync.Mutex`, or have each goroutine send its result on a channel that this body alone receives from and writes into `failedPlatforms`.
Duplicated predicate pkg/proc/native/threads_hardware_singlestep_linux.go:22— `(status == nil || status.Exited()) && wpid == t.dbp.pid` appears character-identically in 2 files — pkg/proc/native/threads_hardware_singlestep_linux.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:103— `a.crosscall2fn != nil && pc >= a.crosscall2fn.Entry && pc < a.crosscall2fn.End` appears character-identically in 5 files — pkg/proc/amd64_arch.go, pkg/proc/arm64_arch.go, pkg/proc/loong64_arch.go, pkg/proc/ppc64le_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:30— `err == syscall.ENODEV || err == syscall.EIO || err == syscall.EINVAL` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:21— `err == syscall.Errno(0) || err == syscall.ENODEV` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:56— `fctxt == nil || (a.sigreturnfn != nil && pc >= a.sigreturnfn.Entry && pc < a.sigreturnfn.End)` appears character-identically in 4 files — pkg/proc/amd64_arch.go, pkg/proc/arm64_arch.go, pkg/proc/loong64_arch.go, pkg/proc/ppc64le_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:233— `it.top || !it.systemstack || it.g == nil` appears character-identically in 5 files — pkg/proc/amd64_arch.go, pkg/proc/arm64_arch.go, pkg/proc/i386_arch.go, pkg/proc/loong64_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:135— `rd == riscv64asm.X0 && rs1 == riscv64asm.X1` appears character-identically in 2 files — REDACTED, pkg/proc/riscv64_disasm.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:355— `reg.Bytes != nil && strings.HasPrefix(n, "st(")` appears character-identically in 2 files — pkg/proc/amd64_arch.go, pkg/proc/i386_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:353— `reg.Bytes != nil && strings.HasPrefix(n, "xmm")` appears character-identically in 2 files — pkg/proc/amd64_arch.go, pkg/proc/i386_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/arm64_arch.go:443— `reg.Bytes == nil || (reg.Bytes != nil && len(reg.Bytes) < 16)` appears character-identically in 2 files — pkg/proc/arm64_arch.go, pkg/proc/ppc64le_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/amd64_arch.go:357— `reg.Bytes == nil || (reg.Bytes != nil && len(reg.Bytes) <= 8)` appears character-identically in 2 files — pkg/proc/amd64_arch.go, pkg/proc/i386_arch.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/fbsdutil/regs.go:242— `regNum < regnum.AMD64_XMM0 || regNum > regnum.AMD64_XMM0+15` appears character-identically in 3 files — pkg/proc/fbsdutil/regs.go, pkg/proc/linutil/regs_amd64_arch.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/linutil/regs_arm64_arch.go:162— `regNum >= regnum.ARM64_V0 && regNum <= regnum.ARM64_V0+30` appears character-identically in 2 files — pkg/proc/linutil/regs_arm64_arch.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/linutil/regs_arm64_arch.go:158— `regNum >= regnum.ARM64_X0 && regNum <= regnum.ARM64_X0+30` appears character-identically in 2 files — pkg/proc/linutil/regs_arm64_arch.go, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:33— `restoreRegistersErr != syscall.Errno(0) && restoreRegistersErr != nil` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate pkg/proc/eval.go:1038— `stack.callInjectionContinue && stack.err == nil` appears character-identically in 2 files — pkg/proc/eval.go, pkg/proc/fncall.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:88— `stdin == nil || !isatty.IsTerminal(stdin.Fd())` appears character-identically in 2 files — REDACTED, pkg/proc/native/proc_linux.go. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Orphaned file pkg/proc/linutil/regs_riscv64_arch.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file service/api/command.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/linutil/regs_ppc64le_arch.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/linutil/regs_loong64_arch.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/ppc64le_disasm.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/config/split.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file service/dap/config.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/loong64_disasm.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/riscv64_disasm.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/dwarf/regnum/ppc64le.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file pkg/proc/x86_disasm.go:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default on error cmd/dlv/cmds/commands.go:950— `getPackageDir` turns a non-nil `err` into `return "."` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
Silent fallback default on error REDACTED:402— `unusedPort` turns a non-nil `err` into `return ":8081"` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/proc/native/proc_linux.go:642— `status` turns a non-nil `err` into `return '\000'` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
Silent fallback default on error pkg/proc/stack.go:381— `frameBase` turns a non-nil `err` into `return 0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
Silent fallback default on error service/debugger/debugger.go:2414— `BuildID` turns a non-nil `err` into `return ""` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or return it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the `if` or in the doc comment, and the row stops firing.
README/code drift README.md:1— README claims AI usage policy is a separate document but no such file exists — searched for: `Documentation/AI/AI_POLICY.md`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest and configuration files (package.json and other *.json, *.csproj, *.props, *.sln/*.slnx, *.yml, *.toml, *.config, tool configs such as eslint.config.js, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
README/code drift Documentation/api/ClientHowto.md:42— Documentation/api/ClientHowto.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift Documentation/internal/portnotes.md:41— Documentation/internal/portnotes.md names `cmd/link`, but no file or folder `cmd/link` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift Documentation/api/json-rpc/README.md:13— Documentation/api/json-rpc/README.md names `service/rpc2.RPCServer`, but no file or folder `service/rpc2.RPCServer` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 5 significant file(s) lose their only recent owner: pkg/dwarf/op/op.go, pkg/dwarf/reader/reader.go, pkg/proc/stackwatch.go, REDACTED, REDACTED. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: service/rpccommon/server.go, pkg/dwarf/line/line_parser.go, pkg/terminal/config.go, pkg/dwarf/godwarf/sections.go. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (12 single-owned of 132 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 132 of the 234 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: pkg/proc/arm64_arch.go, pkg/proc/native/threads_windows.go, pkg/proc/native/syscall_windows.go.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (74094 LoC, 501 module-visible types across 50 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 15 of 132 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 132 of the 234 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: pkg/proc/linutil/regs_riscv64_arch.go, REDACTED, pkg/proc/linutil/regs_ppc64le_arch.go, pkg/proc/linutil/regs_loong64_arch.go, pkg/proc/ppc64le_disasm.go, REDACTED, pkg/proc/loong64_disasm.go, REDACTED (and 7 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.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, 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.
X2 · Cancellation propagation· Not all functions that make a request accept a context.Context · ×1
Not all functions that make a request accept a context.Context — Only 0/2 functions that make a cancellable request (net/http, net.Dial) accept a context.Context or pass one on, so a request keeps running after whatever wanted it has given up — a cancelled request, a shutdown, an expired deadline. Take `ctx context.Context` as the first parameter and build the request with it (`http.NewRequestWithContext`, `DialContext`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Hand-rolled JSON/XML parsing via regex _scripts/gen-faq-toc.go:24— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Go code already uses a real parser in the same package; use it here too.
Outdated: github.com/creack/pty — `github.com/creack/pty` is required at v1.1.20 in REDACTED, but v1.1.24 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/creack/pty@v1.1.24 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/derekparker/trie/v3 — `github.com/derekparker/trie/v3` is required at v3.2.0 in REDACTED, but v3.2.1 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/derekparker/trie/v3@v3.2.1 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/mattn/go-colorable — `github.com/mattn/go-colorable` is required at v0.1.13 in REDACTED, but v0.1.16 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/mattn/go-colorable@v0.1.16 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: github.com/mattn/go-isatty — `github.com/mattn/go-isatty` is required at v0.0.20 in REDACTED, but v0.0.24 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/mattn/go-isatty@v0.0.24 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: go.yaml.in/yaml/v3 — `go.yaml.in/yaml/v3` is required at v3.0.4 in REDACTED, but v3.0.5 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get go.yaml.in/yaml/v3@v3.0.5 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/arch — `golang.org/x/arch` is required at v0.28.0 in REDACTED, but v0.32.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/arch@v0.32.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/sys — `golang.org/x/sys` is required at v0.46.0 in REDACTED, but v0.49.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/sys@v0.49.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Outdated: golang.org/x/text — `golang.org/x/text` is required at v0.40.0 in REDACTED, but v0.43.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get golang.org/x/text@v0.43.0 && go mod tidy` and commit the updated REDACTED and go.sum.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: 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.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a16bc9-0512-764e-965a-7dcebcf17b0b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 1 · Warnings: 717 · Recommendations: 180 · Info: 8 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 24-10-2026 @ 02:41 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.